mbox series

[00/14] Set the lockdep class on eb's at allocation time

Message ID cover.1604091530.git.josef@toxicpanda.com (mailing list archive)
Headers show
Series Set the lockdep class on eb's at allocation time | expand

Message

Josef Bacik Oct. 30, 2020, 9:02 p.m. UTC
Hello,

We've had a lockdep splat show up a few times recently where the extent buffer
doesn't have it's lockdep class set properly.  This can happen if you have
concurrent readers hitting the same block that's not in cache.

This is sort of straightforward to fix, but unfortunately requires quite a bit
of code churn to do it cleanly.  The bulck of these patches are replacing open
coded calls of btrfs_read_node_slot() with the helper to cut down on the number
of people directly calling read_tree_block().  I also cleaned up the readahead
helpers because passing all these arguments around would be unweildy.  The last
patch in the series is the actual fix for what Filipe and Fedora QA saw.

The patches that actually have meaningful changes are

  btrfs: remove lockdep classes for the fs tree
  btrfs: cleanup extent buffer readahead
  btrfs: set the lockdep class for ebs on creation

The rest are cleanups or adding arguments to various functions, so aren't too
tricky.  I've put this through a quick xfstest run for sanity sake, it didn't
appear to break anything, but the full run is still going.  Thanks,

Josef

Josef Bacik (14):
  btrfs: remove lockdep classes for the fs tree
  btrfs: cleanup extent buffer readahead
  btrfs: use btrfs_read_node_slot in btrfs_realloc_node
  btrfs: use btrfs_read_node_slot in walk_down_reloc_tree
  btrfs: use btrfs_read_node_slot in do_relocation
  btrfs: use btrfs_read_node_slot in replace_path
  btrfs: use btrfs_read_node_slot in walk_down_tree
  btrfs: use btrfs_read_node_slot in qgroup_trace_extent_swap
  btrfs: use btrfs_read_node_slot in qgroup_trace_new_subtree_blocks
  btrfs: use btrfs_read_node_slot in btrfs_qgroup_trace_subtree
  btrfs: pass root owner to read_tree_block
  btrfs: pass the root owner and level around for reada
  btrfs: pass the owner_root and level to alloc_extent_buffer
  btrfs: set the lockdep class for ebs on creation

 fs/btrfs/backref.c     |  6 +--
 fs/btrfs/ctree.c       | 86 +++++++++---------------------------------
 fs/btrfs/disk-io.c     | 41 +++++++-------------
 fs/btrfs/disk-io.h     |  8 ++--
 fs/btrfs/extent-tree.c | 20 ++++++----
 fs/btrfs/extent_io.c   | 55 ++++++++++++++++++++++++++-
 fs/btrfs/extent_io.h   |  6 ++-
 fs/btrfs/print-tree.c  |  1 +
 fs/btrfs/qgroup.c      | 43 ++++-----------------
 fs/btrfs/reada.c       | 32 +++++++++++-----
 fs/btrfs/ref-verify.c  | 18 +--------
 fs/btrfs/relocation.c  | 45 +++++-----------------
 fs/btrfs/tree-log.c    |  4 +-
 fs/btrfs/volumes.c     | 12 ++----
 14 files changed, 157 insertions(+), 220 deletions(-)