浏览代码

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 <mike.fleetwood@googlemail.com>
Mike Fleetwood 13 年之前
父节点
当前提交
ece7d20e8b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/btrfs/ioctl.c

+ 1 - 1
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);
 		ret = btrfs_grow_device(trans, device, new_size);
 		btrfs_commit_transaction(trans, root);
 		btrfs_commit_transaction(trans, root);
-	} else {
+	} else if (new_size < old_size) {
 		ret = btrfs_shrink_device(device, new_size);
 		ret = btrfs_shrink_device(device, new_size);
 	}
 	}