提交 0253f40e 编写于 作者: J jeff.liu 提交者: Josef Bacik

Btrfs: Remove the invalid shrink size check up from btrfs_shrink_dev()

Remove an invalid size check up from btrfs_shrink_dev().

The new size should not larger than the device->total_bytes as it was
already verified before coming to here(i.e. new_size < old_size).

Remove invalid check up for btrfs_shrink_dev().
Signed-off-by: NJie Liu <jeff.liu@oracle.com>
Signed-off-by: NChris Mason <chris.mason@fusionio.com>
上级 9afab882
......@@ -1409,7 +1409,7 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root,
btrfs_commit_transaction(trans, root);
} else if (new_size < old_size) {
ret = btrfs_shrink_device(device, new_size);
}
} /* equal, nothing need to do */
out_free:
kfree(vol_args);
......
......@@ -3059,9 +3059,6 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
u64 old_size = device->total_bytes;
u64 diff = device->total_bytes - new_size;
if (new_size >= device->total_bytes)
return -EINVAL;
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册