Message ID | 145f1008e1f813a6a23677e9fe5b64f780824c3d.1604591048.git.josef@toxicpanda.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Set the lockdep class on eb's at allocation time | expand |
On Thu, Nov 5, 2020 at 3:47 PM Josef Bacik <josef@toxicpanda.com> wrote: > > We're open-coding btrfs_read_node_slot() here, replace with the helper. > > Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> I couldn't get anymore the lockdep splat I reported before (after applying the whole patchset of course), it used to happen very often with btrfs/033. Looks good, thanks. > --- > fs/btrfs/ref-verify.c | 18 ++---------------- > 1 file changed, 2 insertions(+), 16 deletions(-) > > diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c > index 488bc3dd3c2b..4b9b6c52a83b 100644 > --- a/fs/btrfs/ref-verify.c > +++ b/fs/btrfs/ref-verify.c > @@ -551,29 +551,15 @@ static int process_leaf(struct btrfs_root *root, > static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path, > int level, u64 *bytenr, u64 *num_bytes) > { > - struct btrfs_fs_info *fs_info = root->fs_info; > struct extent_buffer *eb; > - u64 block_bytenr, gen; > int ret = 0; > > while (level >= 0) { > if (level) { > - struct btrfs_key first_key; > - > - block_bytenr = btrfs_node_blockptr(path->nodes[level], > - path->slots[level]); > - gen = btrfs_node_ptr_generation(path->nodes[level], > - path->slots[level]); > - btrfs_node_key_to_cpu(path->nodes[level], &first_key, > - path->slots[level]); > - eb = read_tree_block(fs_info, block_bytenr, gen, > - level - 1, &first_key); > + eb = btrfs_read_node_slot(path->nodes[level], > + path->slots[level]); > if (IS_ERR(eb)) > return PTR_ERR(eb); > - if (!extent_buffer_uptodate(eb)) { > - free_extent_buffer(eb); > - return -EIO; > - } > btrfs_tree_read_lock(eb); > path->nodes[level-1] = eb; > path->slots[level-1] = 0; > -- > 2.26.2 >
diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c index 488bc3dd3c2b..4b9b6c52a83b 100644 --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -551,29 +551,15 @@ static int process_leaf(struct btrfs_root *root, static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path, int level, u64 *bytenr, u64 *num_bytes) { - struct btrfs_fs_info *fs_info = root->fs_info; struct extent_buffer *eb; - u64 block_bytenr, gen; int ret = 0; while (level >= 0) { if (level) { - struct btrfs_key first_key; - - block_bytenr = btrfs_node_blockptr(path->nodes[level], - path->slots[level]); - gen = btrfs_node_ptr_generation(path->nodes[level], - path->slots[level]); - btrfs_node_key_to_cpu(path->nodes[level], &first_key, - path->slots[level]); - eb = read_tree_block(fs_info, block_bytenr, gen, - level - 1, &first_key); + eb = btrfs_read_node_slot(path->nodes[level], + path->slots[level]); if (IS_ERR(eb)) return PTR_ERR(eb); - if (!extent_buffer_uptodate(eb)) { - free_extent_buffer(eb); - return -EIO; - } btrfs_tree_read_lock(eb); path->nodes[level-1] = eb; path->slots[level-1] = 0;
We're open-coding btrfs_read_node_slot() here, replace with the helper. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- fs/btrfs/ref-verify.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)