All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Fix locking when scanning devices
@ 2018-06-20 17:51 David Sterba
  2018-06-20 17:51 ` [PATCH 1/7] btrfs: restore uuid_mutex in btrfs_open_devices David Sterba
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: David Sterba @ 2018-06-20 17:51 UTC (permalink / raw)
  To: linux-btrfs; +Cc: anand.jain, David Sterba

This patchset fixes the bugs recently reported by syzbot. I've tried to
use patches from Anand [1] to fix that but in the end there were fixes
not suitable for merging to 4.18 and my final fix took a different
approach.

In short, fs_devices::opened is protected by uuid_mutex and this mutex
can be used to exclude mount and scanning to interfere.

The fstests pass and 2 syzbot reproducers reported no problems. I'd like
to push the patchset to 4.18 but not rc2 as it's too close. I'll add the
patchset to for-next soon if there are no major problems found, but
otherwise I'm open to comments.

[1]
https://patchwork.kernel.org/patch/10446779/
https://patchwork.kernel.org/patch/10437707/ 1-6

David Sterba (7):
  btrfs: restore uuid_mutex in btrfs_open_devices
  btrfs: extend critical section when scanning a new device
  btrfs: lift uuid_mutex to callers of btrfs_scan_one_device
  btrfs: lift uuid_mutex to callers of btrfs_open_devices
  btrfs: lift uuid_mutex to callers of btrfs_parse_early_options
  btrfs: reorder initialization before the mount locks uuid_mutex
  btrfs: fix mount and ioctl device scan ioctl race

 fs/btrfs/super.c   | 38 +++++++++++++++++++++++++-------------
 fs/btrfs/volumes.c | 11 ++++++-----
 2 files changed, 31 insertions(+), 18 deletions(-)

-- 
2.17.0


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

end of thread, other threads:[~2018-07-13 13:09 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20 17:51 [PATCH 0/7] Fix locking when scanning devices David Sterba
2018-06-20 17:51 ` [PATCH 1/7] btrfs: restore uuid_mutex in btrfs_open_devices David Sterba
2018-07-04  8:09   ` Anand Jain
2018-07-13 12:49     ` David Sterba
2018-06-20 17:51 ` [PATCH 2/7] btrfs: extend critical section when scanning a new device David Sterba
2018-06-26  7:34   ` Anand Jain
2018-07-04  8:18   ` Anand Jain
2018-07-13 12:55     ` David Sterba
2018-06-20 17:51 ` [PATCH 3/7] btrfs: lift uuid_mutex to callers of btrfs_scan_one_device David Sterba
2018-07-04  8:19   ` Anand Jain
2018-06-20 17:51 ` [PATCH 4/7] btrfs: lift uuid_mutex to callers of btrfs_open_devices David Sterba
2018-07-04  8:19   ` Anand Jain
2018-06-20 17:51 ` [PATCH 5/7] btrfs: lift uuid_mutex to callers of btrfs_parse_early_options David Sterba
2018-07-04  8:20   ` Anand Jain
2018-06-20 17:51 ` [PATCH 6/7] btrfs: reorder initialization before the mount locks uuid_mutex David Sterba
2018-07-04  8:21   ` Anand Jain
2018-06-20 17:51 ` [PATCH 7/7] btrfs: fix mount and ioctl device scan ioctl race David Sterba
2018-06-26  9:33   ` Anand Jain
2018-07-04  8:22   ` Anand Jain
2018-06-21  7:48 ` [PATCH 0/7] Fix locking when scanning devices Nikolay Borisov
2018-06-22 11:39   ` 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.