Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2bf6e89 authored by Anand Jain's avatar Anand Jain Committed by David Sterba
Browse files

btrfs: make sure device is synced before return



An inconsistent behavior due to stale reads from the
disk was reported

  mail-archive.com/linux-btrfs@vger.kernel.org/msg54188.html

This patch will make sure devices are synced before
return in the unmount thread.

Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent f448341a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -870,6 +870,11 @@ static void btrfs_close_one_device(struct btrfs_device *device)
	if (device->missing)
		fs_devices->missing_devices--;

	if (device->bdev && device->writeable) {
		sync_blockdev(device->bdev);
		invalidate_bdev(device->bdev);
	}

	new_device = btrfs_alloc_device(NULL, &device->devid,
					device->uuid);
	BUG_ON(IS_ERR(new_device)); /* -ENOMEM */