Skip to content

Commit

Permalink
ext4: add online resizing support for meta_bg and 64-bit file systems
Browse files Browse the repository at this point in the history
This patch adds support for resizing file systems with the meta_bg and
64bit features.

[ Added a fix by tytso to fix a divide by zero when resizing a
  filesystem from 14 TB to 18TB.  Also fixed overhead accounting for
  meta_bg file systems.]

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
xiaoqiangnk authored and tytso committed Sep 5, 2012
1 parent 28623c2 commit 01f795f
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 65 deletions.
15 changes: 0 additions & 15 deletions fs/ext4/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,26 +365,11 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
return -EOPNOTSUPP;
}

if (EXT4_HAS_INCOMPAT_FEATURE(sb,
EXT4_FEATURE_INCOMPAT_META_BG)) {
ext4_msg(sb, KERN_ERR,
"Online resizing not (yet) supported with meta_bg");
return -EOPNOTSUPP;
}

if (copy_from_user(&n_blocks_count, (__u64 __user *)arg,
sizeof(__u64))) {
return -EFAULT;
}

if (n_blocks_count > MAX_32_NUM &&
!EXT4_HAS_INCOMPAT_FEATURE(sb,
EXT4_FEATURE_INCOMPAT_64BIT)) {
ext4_msg(sb, KERN_ERR,
"File system only supports 32-bit block numbers");
return -EOPNOTSUPP;
}

err = ext4_resize_begin(sb);
if (err)
return err;
Expand Down
Loading

0 comments on commit 01f795f

Please sign in to comment.