Skip to contentSkip to conversation

ext4: Do not convert to indirect with bigalloc enabled

PATCH Applied Lukas Czerner 3 participants 6 messages Apr 4, 2013 – Apr 9, 2013 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: Do not convert to indirect with bigalloc enabled

With bigalloc feature enabled we do not support indirect addressing at all so we have to prevent extent addressing to indirect addressing conversion in this case. The problem has been introduced with the commit "ext4: support simple conversion of extent-mapped inodes to use i_blocks"

---
 fs/ext4/extents.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/ext4/extents.c +4 -0
index 6c5a70a..ddb6628 100644
@@ -4735,6 +4735,10 @@ int ext4_ind_migrate(struct inode *inode)
 	    (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
 		return -EINVAL;
 
+	if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
+				       EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+		return -EOPNOTSUPP;
+
 	down_write(&EXT4_I(inode)->i_data_sem);
 	ret = ext4_ext_check_inode(inode);
 	if (ret)
Signature · 1 line
1.7.7.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Lukas Czerner

With bigalloc feature enabled we do not support indirect addressing at all so we have to prevent extent addressing to indirect addressing conversion in this case. The problem has been introduced with the commit "ext4: support simple conversion of extent-mapped inodes to use i_blocks"

Looks good to me.

Regards,
- Zheng

Quoted 26 lines
---
 fs/ext4/extents.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/ext4/extents.c +4 -0
index 6c5a70a..ddb6628 100644
@@ -4735,6 +4735,10 @@ int ext4_ind_migrate(struct inode *inode)
 	    (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
 		return -EINVAL;
 
+	if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
+				       EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+		return -EOPNOTSUPP;
+
 	down_write(&EXT4_I(inode)->i_data_sem);
 	ret = ext4_ext_check_inode(inode);
 	if (ret)
Signature · 6 lines
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to Lukas Czerner
Quoted 15 lines · Lukas Czerner

With bigalloc feature enabled we do not support indirect addressing at all so we have to prevent extent addressing to indirect addressing conversion in this case. The problem has been introduced with the commit "ext4: support simple conversion of extent-mapped inodes to use i_blocks"

---
 fs/ext4/extents.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/ext4/extents.c +0 -0
index 6c5a70a..ddb6628 100644

fs/ext4/extents.c int ext4_ind_migrate(struct inode *inode) · line 4744

Quoted 10 lines
fs/ext4/extents.c +4 -0
@@ -4735,6 +4735,10 @@ int ext4_ind_migrate(struct inode *inode)
 	    (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
 		return -EINVAL;
 
+	if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
+				       EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+		return -EOPNOTSUPP;
+
 	down_write(&EXT4_I(inode)->i_data_sem);
 	ret = ext4_ext_check_inode(inode);
 	if (ret)

I am wandering whether ext4_ind_migrate needs to be moved into fs/ext4/migrate.c file. Maybe it is better.

Regards,
- Zheng

#3 lore raw
Quoted 25 lines · Zheng Liu

Date: Mon, 8 Apr 2013 14:10:11 +0800
From: Zheng Liu <[email protected]>
To: Lukas Czerner <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH] ext4: Do not convert to indirect with bigalloc enabled

Quoted 18 lines · Lukas Czerner

With bigalloc feature enabled we do not support indirect addressing at all so we have to prevent extent addressing to indirect addressing conversion in this case. The problem has been introduced with the commit "ext4: support simple conversion of extent-mapped inodes to use i_blocks"

---
 fs/ext4/extents.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/ext4/extents.c +0 -0
index 6c5a70a..ddb6628 100644
@@ -4735,6 +4735,10 @@ int ext4_ind_migrate(struct inode *inode)
 	    (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
 		return -EINVAL;
 
Quoted 10 lines

fs/ext4/extents.c int ext4_ind_migrate(struct inode *inode) · line 4744

Quoted 7 lines
fs/ext4/extents.c +4 -0
+	if (EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,
+				       EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+		return -EOPNOTSUPP;
+
 	down_write(&EXT4_I(inode)->i_data_sem);
 	ret = ext4_ext_check_inode(inode);
 	if (ret)

I am wandering whether ext4_ind_migrate needs to be moved into fs/ext4/migrate.c file. Maybe it is better.

You're right, it make much more sense. I'll prepare a patch.

Thanks!
-Lukas

Quoted 4 lines

Regards,
- Zheng

#5 lore raw
Quoted 6 lines · Theodore Ts'o

Date: Tue, 9 Apr 2013 09:23:13 -0400
From: Theodore Ts'o <[email protected]>
To: Lukas Czerner <[email protected]>, [email protected]
Subject: Re: [PATCH] ext4: Do not convert to indirect with bigalloc enabled

Thanks, applied.

Ted you probably want to apply the series I sent earlier today containing this patches.

[PATCH 1/2 v2] ext4: move ext4_ind_migrate() into migrate.c [PATCH 2/2 v2] ext4: Do not convert to indirect with bigalloc enabled

Thanks!
-Lukas

Quoted 3 lines

- Ted