All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] btrfs: consolidate seed mutex to sprout mutex
@ 2020-08-14  0:03 Anand Jain
  2020-08-14  0:03 ` [PATCH 1/7] btrfs: reada: use sprout device_list_mutex Anand Jain
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Anand Jain @ 2020-08-14  0:03 UTC (permalink / raw)
  To: linux-btrfs

In a sprouted btrfs, the seed's fs_devices are cloned and link-
listed under the sprout's fs_devices. The fs_info::fs_devices
points to the sprout::fs_devices and various critical operations
like device-delete holds the top-level device_list_mutex
sprout::fs_devices::device_list_mutex and _not_ the seed level
mutex such as sprout::fs_devices::seed::fs_devices::device_list_mutex.

Also all related readers (except for two threads- reada and init_devices_late)
hold the sprout::fs_devices::device_list_mutex too. And those two threads
which are missing to hold the correct lock are being fixed here.

I take the approach to fix the read end instead of fixing the writer end
which are not holding the seed level mutex because to keep things
simple and there isn't much benefit burning extra CPU cycles in going 
through the lock/unlock process as we traverse through the
fs_devices::seed fs_devices (for example as in reada and init_devices_late
threads).

The first two patches (1/7, 2/7) fixes the threads using the
seed::device_list_mutex.

And rest of the patches ([3-7]/7) are cleanups and these patches
are independent by themself.

These patchset has been tested with full xfstests btrfs test cases and
found to have no new regressions.

Anand Jain (7):
  btrfs: reada: use sprout device_list_mutex
  btrfs: btrfs_init_devices_late: use sprout device_list_mutex
  btrfs: open code list_head pointer in btrfs_init_dev_replace_tgtdev
  btrfs: cleanup unused return in btrfs_close_devices
  btrfs: cleanup btrfs_assign_next_active_device()
  btrfs: cleanup unnecessary goto in open_seed_device
  btrfs: btrfs_dev_replace_update_device_in_mapping_tree drop file
    global declare

 fs/btrfs/dev-replace.c | 60 +++++++++++++++++++-----------------------
 fs/btrfs/reada.c       |  4 +--
 fs/btrfs/volumes.c     | 42 +++++++++++------------------
 fs/btrfs/volumes.h     |  2 +-
 4 files changed, 46 insertions(+), 62 deletions(-)

-- 
2.18.2


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-08-24 16:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14  0:03 [PATCH 0/7] btrfs: consolidate seed mutex to sprout mutex Anand Jain
2020-08-14  0:03 ` [PATCH 1/7] btrfs: reada: use sprout device_list_mutex Anand Jain
2020-08-14  0:03 ` [PATCH 2/7] btrfs: btrfs_init_devices_late: " Anand Jain
2020-08-14  0:03 ` [PATCH 3/7] btrfs: open code list_head pointer in btrfs_init_dev_replace_tgtdev Anand Jain
2020-08-14  0:03 ` [PATCH 4/7] btrfs: cleanup unused return in btrfs_close_devices Anand Jain
2020-08-14  8:53   ` Nikolay Borisov
2020-08-14  0:03 ` [PATCH 5/7] btrfs: cleanup btrfs_assign_next_active_device() Anand Jain
2020-08-14  0:03 ` [PATCH 6/7] btrfs: cleanup unnecessary goto in open_seed_device Anand Jain
2020-08-14  0:03 ` [PATCH 7/7] btrfs: btrfs_dev_replace_update_device_in_mapping_tree drop file global declare Anand Jain
2020-08-24 16:48 ` [PATCH 0/7] btrfs: consolidate seed mutex to sprout mutex David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.