Btrfs: Don't error on resizing FS to same size
authorMike Fleetwood <mike.fleetwood@googlemail.com>
Fri, 18 Nov 2011 18:55:01 +0000 (18:55 +0000)
committerDavid Sterba <dsterba@suse.cz>
Wed, 30 Nov 2011 17:46:04 +0000 (18:46 +0100)
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 <mike.fleetwood@googlemail.com>
fs/btrfs/ioctl.c

index a90e749..72d4616 100644 (file)
@@ -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);
        }