Re: [PATCH v2] btrfs: fix mount failure caused by race with umount

2020-07-16 Thread David Sterba
On Fri, Jul 10, 2020 at 10:23:04AM -0700, Boris Burkov wrote: > Here is the sequence laid out in greater detail: > > CPU0CPU1 > down_write sb->s_umount > btrfs_kill_super > kill_anon_super(sb) > generic_shutdown_super(sb); > shrink_dc

Re: [PATCH v2] btrfs: fix mount failure caused by race with umount

2020-07-10 Thread Josef Bacik
On 7/10/20 1:23 PM, Boris Burkov wrote: It is possible to cause a btrfs mount to fail by racing it with a slow umount. The crux of the sequence is generic_shutdown_super not yet calling sop->put_super before btrfs_mount_root calls btrfs_open_devices. If that occurs, btrfs_open_devices will decide

[PATCH v2] btrfs: fix mount failure caused by race with umount

2020-07-10 Thread Boris Burkov
It is possible to cause a btrfs mount to fail by racing it with a slow umount. The crux of the sequence is generic_shutdown_super not yet calling sop->put_super before btrfs_mount_root calls btrfs_open_devices. If that occurs, btrfs_open_devices will decide the opened counter is non-zero, increment