Skip to contentSkip to conversation

ext4: disable COLLAPSE_RANGE for bigalloc

PATCH In review Namjae Jeon 2 participants 3 messages Apr 16, 2014 – Apr 17, 2014 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 ext4: disable COLLAPSE_RANGE for bigalloc

From: Namjae Jeon <[email protected]>

Once COLLAPSE RANGE is be disable for ext4 with bigalloc feature till finding root-cause of problem. It will be enable with fixing that regression of xfstest(generic 075 and 091) again.

---
 fs/ext4/extents.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/ext4/extents.c +5 -0
index a64242f..8d45ef8 100644
@@ -5461,6 +5461,11 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
 		goto out_mutex;
 	}
 
+	if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1) {
+		ret = -EOPNOTSUPP;
+		goto out_mutex;
+	}
+
 	truncate_pagecache_range(inode, ioffset, -1);
 
 	/* Wait for existing dio to complete */
Signature · 1 line
1.7.11-rc0
Reviewed-by on v1 3/3
#1 lore raw
Quoted 24 lines · Namjae Jeon

Date: Thu, 17 Apr 2014 07:30:54 +0900
From: Namjae Jeon <[email protected]>
To: Theodore Ts'o <[email protected]>
Cc: linux-ext4 <[email protected]>,
Lukáš Czerner <[email protected]>
Subject: [PATCH 3/3] ext4: disable COLLAPSE_RANGE for bigalloc

From: Namjae Jeon <[email protected]>

Once COLLAPSE RANGE is be disable for ext4 with bigalloc feature till finding root-cause of problem. It will be enable with fixing that regression of xfstest(generic 075 and 091) again.

---
 fs/ext4/extents.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/ext4/extents.c +0 -0
index a64242f..8d45ef8 100644

fs/ext4/extents.c int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len) · line 5468

Quoted 8 lines
fs/ext4/extents.c +5 -0
@@ -5461,6 +5461,11 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
 		goto out_mutex;
 	}
 
+	if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1) {
+		ret = -EOPNOTSUPP;
+		goto out_mutex;
+	}
+

I do not think we need to hold mutex for this. You can move it to the beginning of the function preferably right after S_ISREG check.

Otherwise it looks ok, but it would be better if we could fix it :)

Quoted 4 lines
fs/ext4/extents.c +0 -0
 	truncate_pagecache_range(inode, ioffset, -1);
 
 	/* Wait for existing dio to complete */
#2 lore raw
Quoted 12 lines

fs/ext4/extents.c int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len) · line 5468

Quoted 8 lines
fs/ext4/extents.c +5 -0
 	}
 
+	if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1) {
+		ret = -EOPNOTSUPP;
+		goto out_mutex;
+	}
+

I do not think we need to hold mutex for this. You can move it to the beginning of the function preferably right after S_ISREG check.

Quoted 1 line

Otherwise it looks ok, but it would be better if we could fix it :)

Okay, Thanks for review!

Quoted 7 lines
Quoted 4 lines
fs/ext4/extents.c +0 -0
 	truncate_pagecache_range(inode, ioffset, -1);
 
 	/* Wait for existing dio to complete */