diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2014-07-29 10:45:31 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-07-29 10:45:31 -0400 |
commit | ee98fa3a8b148a234600a20f7cdc2b4b37f38083 (patch) | |
tree | 9eebef51b71c1a2700c6c3a66a62af95569d4e58 /fs | |
parent | 40b163f1c45f52752677e66d2fd273dbfd273a22 (diff) |
ext4: fix COLLAPSE RANGE test for bigalloc file systems
Blocks in collapse range should be collapsed per cluster unit when
bigalloc is enable. If bigalloc is not enable, EXT4_CLUSTER_SIZE will
be same with EXT4_BLOCK_SIZE.
With this bug fixed, patch enables COLLAPSE_RANGE for bigalloc, which
fixes a large number of xfstest failures which use fsx.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/extents.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 6950babecde7..76c2df382b7d 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -5404,16 +5404,13 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len) | |||
5404 | int ret; | 5404 | int ret; |
5405 | 5405 | ||
5406 | /* Collapse range works only on fs block size aligned offsets. */ | 5406 | /* Collapse range works only on fs block size aligned offsets. */ |
5407 | if (offset & (EXT4_BLOCK_SIZE(sb) - 1) || | 5407 | if (offset & (EXT4_CLUSTER_SIZE(sb) - 1) || |
5408 | len & (EXT4_BLOCK_SIZE(sb) - 1)) | 5408 | len & (EXT4_CLUSTER_SIZE(sb) - 1)) |
5409 | return -EINVAL; | 5409 | return -EINVAL; |
5410 | 5410 | ||
5411 | if (!S_ISREG(inode->i_mode)) | 5411 | if (!S_ISREG(inode->i_mode)) |
5412 | return -EINVAL; | 5412 | return -EINVAL; |
5413 | 5413 | ||
5414 | if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1) | ||
5415 | return -EOPNOTSUPP; | ||
5416 | |||
5417 | trace_ext4_collapse_range(inode, offset, len); | 5414 | trace_ext4_collapse_range(inode, offset, len); |
5418 | 5415 | ||
5419 | punch_start = offset >> EXT4_BLOCK_SIZE_BITS(sb); | 5416 | punch_start = offset >> EXT4_BLOCK_SIZE_BITS(sb); |