diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6b9cff42265d06e5b26a7ed53684a5551675a930..5989a92236f7f1b578ec3ccf88078bb69c1093d3 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -684,6 +684,12 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) __btrfs_close_devices(fs_devices); free_fs_devices(fs_devices); } + /* + * Wait for rcu kworkers under __btrfs_close_devices + * to finish all blkdev_puts so device is really + * free when umount is done. + */ + rcu_barrier(); return ret; }