linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: fix COLLAPSE RANGE test failure when bigalloc is enable
@ 2014-06-04  8:08 Namjae Jeon
  2014-06-04 13:27 ` Lukáš Czerner
  2014-06-17 22:09 ` Theodore Ts'o
  0 siblings, 2 replies; 7+ messages in thread
From: Namjae Jeon @ 2014-06-04  8:08 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4, Ashish Sangwan

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.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
---
 fs/ext4/extents.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 4da228a..2b9f5f3 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -5403,16 +5403,13 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
 	int ret;
 
 	/* Collapse range works only on fs block size aligned offsets. */
-	if (offset & (EXT4_BLOCK_SIZE(sb) - 1) ||
-	    len & (EXT4_BLOCK_SIZE(sb) - 1))
+	if (offset & (EXT4_CLUSTER_SIZE(sb) - 1) ||
+	    len & (EXT4_CLUSTER_SIZE(sb) - 1))
 		return -EINVAL;
 
 	if (!S_ISREG(inode->i_mode))
 		return -EINVAL;
 
-	if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1)
-		return -EOPNOTSUPP;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-30  4:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-04  8:08 [PATCH] ext4: fix COLLAPSE RANGE test failure when bigalloc is enable Namjae Jeon
2014-06-04 13:27 ` Lukáš Czerner
2014-06-05  8:48   ` Namjae Jeon
2014-06-17 22:09 ` Theodore Ts'o
2014-06-19  4:51   ` Namjae Jeon
2014-07-29 14:47     ` Theodore Ts'o
2014-07-30  4:36       ` Namjae Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).