Skip to content

Commit ee98fa3

Browse files
Namjae Jeontytso
authored andcommitted
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>
1 parent 40b163f commit ee98fa3

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎fs/ext4/extents.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5404,16 +5404,13 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
54045404
int ret;
54055405

54065406
/* Collapse range works only on fs block size aligned offsets. */
5407-
if (offset & (EXT4_BLOCK_SIZE(sb) - 1) ||
5408-
len & (EXT4_BLOCK_SIZE(sb) - 1))
5407+
if (offset & (EXT4_CLUSTER_SIZE(sb) - 1) ||
5408+
len & (EXT4_CLUSTER_SIZE(sb) - 1))
54095409
return -EINVAL;
54105410

54115411
if (!S_ISREG(inode->i_mode))
54125412
return -EINVAL;
54135413

5414-
if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1)
5415-
return -EOPNOTSUPP;
5416-
54175414
trace_ext4_collapse_range(inode, offset, len);
54185415

54195416
punch_start = offset >> EXT4_BLOCK_SIZE_BITS(sb);

0 commit comments

Comments
 (0)