Skip to content

Commit

Permalink
Btrfs: Don't error on resizing FS to same size
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mfleetwo authored and kdave committed Nov 30, 2011
1 parent aa38a71 commit ece7d20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit ece7d20

Please sign in to comment.