summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 11:15:46 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-09-17 18:55:09 -0700
commit23a4976f6c819d95eac1e8eb862ecdcfe3ac8632 (patch)
tree72a26257a2ba6256471c7e79338da1d094b28b4e /init
parent8ab625318d042bc0421745b2f8d1ad7d8b88c830 (diff)
xfs: update btree keys correctly when _insrec splits an inode root blockbtree-ifork-records_2021-09-17
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 'init')
0 files changed, 0 insertions, 0 deletions