summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:15:22 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:17:04 -0700
commit3df256466f05f1880e0e96bcb428f232a74e9288 (patch)
treeeefe2bd55bb4b08a6030eb3625e68aa9a11ff8c2 /usr
parent466243ac4e24f374f2767a50e59c6b85a3f67166 (diff)
xfs: update btree keys correctly when _insrec splits an inode root blockbtree-ifork-records_2022-10-14
In commit 2c813ad66a72, I partially fixed a bug wherein xfs_btree_insrec would erroneously try to update the parent's key for a block that had been split if we decided to insert the new record into the new block. The solution was to detect this situation and update the in-core key value that we pass up to the caller so that the caller will (eventually) add the new block to the parent level of the tree with the correct key. However, I missed a subtlety about the way inode-rooted btrees work. If the full block was a maximally sized inode root block, we'll solve that fullness by moving the root block's records to a new block, resizing the root block, and updating the root to point to the new block. We don't pass a pointer to the new block to the caller because that work has already been done. The new record will /always/ land in the new block, so in this case we need to use xfs_btree_update_keys to update the keys. This bug can theoretically manifest itself in the very rare case that we split a bmbt root block and the new record lands in the very first slot of the new block, though I've never managed to trigger it in practice. However, it is very easy to reproduce by running generic/522 with the realtime rmapbt patchset if rtinherit=1. Fixes: 2c813ad66a72 ("xfs: support btrees with overlapping intervals for keys") Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions