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-Tag: v2.6.39-400.9.0~824^2~27 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=791ad57ae08d39883dcbe3d1184d58d7539f41e2;p=users%2Fjedix%2Flinux-maple.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 (cherry picked from commit ece7d20e8be6730fbb29f4550de6b19b1a3a9387) --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 077d2b600433..b6da562354ea 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1286,7 +1286,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); }