Skip to content

Commit ece7d20

Browse files
mfleetwokdave
authored andcommitted
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 <[email protected]>
1 parent aa38a71 commit ece7d20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root,
12781278
}
12791279
ret = btrfs_grow_device(trans, device, new_size);
12801280
btrfs_commit_transaction(trans, root);
1281-
} else {
1281+
} else if (new_size < old_size) {
12821282
ret = btrfs_shrink_device(device, new_size);
12831283
}
12841284

0 commit comments

Comments
 (0)