From: Mike Fleetwood Date: Fri, 18 Nov 2011 18:55:01 +0000 (+0000) Subject: Btrfs: Don't error on resizing FS to same size X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ece7d20e8be6730fbb29f4550de6b19b1a3a9387;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Btrfs: Don't error on resizing FS to same size It seems overly harsh to fail a resize of a btrfs file system to the same size when a shrink or grow would succeed. User app GParted trips over this error. Allow it by bypassing the shrink or grow operation. Signed-off-by: Mike Fleetwood --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a90e749ed6d2..72d461656f60 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1278,7 +1278,7 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root, } ret = btrfs_grow_device(trans, device, new_size); btrfs_commit_transaction(trans, root); - } else { + } else if (new_size < old_size) { ret = btrfs_shrink_device(device, new_size); }