Skip to contentSkip to conversation

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

PATCH New Jeff Liu 1 participant 1 message Oct 27, 2012 Btrfs file system

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 1/1 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().

---
 fs/btrfs/ioctl.c   |    2 +-
 fs/btrfs/volumes.c |    3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)
fs/btrfs/ioctl.c +0 -0
index 9df50fa..a747da9 100644
@@ -1383,7 +1383,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);

fs/btrfs/volumes.c +0 -0
index 88b969a..8fda4fb 100644
@@ -3038,9 +3038,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;

Signature · 1 line
1.7.9.5