Skip to contentSkip to conversation

don't set extents flag for _any_ symlinks

PATCH In review Eric Sandeen 2 participants 2 messages Feb 18, 2008 – Feb 19, 2008 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't set extents flag for _any_ symlinks

As symlinks are limited to a single block anyway, and e2fsck doesn't expect to find it set, don't set the extents flag on any type of symlinks at all: fast/in-inode, or the external-block flavor.

There are a lot of filesystems out there by now w/ exent-style symlink blocks though, so e2fsck should probably be able to repair that at some point...

---

fs/ext4/namei.c +0 -1
Index: linux-2.6.24/fs/ext4/namei.c
===================================================================
@@ -2223,7 +2226,6 @@ retry:
 		inode->i_op = &ext4_fast_symlink_inode_operations;
 		memcpy((char*)&EXT4_I(inode)->i_data,symname,l);
 		inode->i_size = l-1;
-		EXT4_I(inode)->i_flags &= ~EXT4_EXTENTS_FL;
 	}
 	EXT4_I(inode)->i_disksize = inode->i_size;
 	err = ext4_add_nondir(handle, dentry, inode);
fs/ext4/ialloc.c +1 -1
Index: linux-2.6.24/fs/ext4/ialloc.c
===================================================================
@@ -744,7 +744,7 @@ got:
 		ext4_std_error(sb, err);
 		goto fail_free_drop;
 	}
-	if (test_opt(sb, EXTENTS)) {
+	if (test_opt(sb, EXTENTS) && !S_ISLNK(mode)) {
 		EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL;
 		ext4_ext_tree_init(handle, inode);
 		err = ext4_update_incompat_feature(handle, sb,
#1 lore raw

Thanks, Added to patch queue

Quoted 44 lines · Eric Sandeen

As symlinks are limited to a single block anyway, and e2fsck doesn't expect to find it set, don't set the extents flag on any type of symlinks at all: fast/in-inode, or the external-block flavor.

There are a lot of filesystems out there by now w/ exent-style symlink blocks though, so e2fsck should probably be able to repair that at some point...

---

Index: linux-2.6.24/fs/ext4/namei.c
===================================================================

fs/ext4/namei.c +0 -1
@@ -2223,7 +2226,6 @@ retry:
 		inode->i_op = &ext4_fast_symlink_inode_operations;
 		memcpy((char*)&EXT4_I(inode)->i_data,symname,l);
 		inode->i_size = l-1;
-		EXT4_I(inode)->i_flags &= ~EXT4_EXTENTS_FL;
 	}
 	EXT4_I(inode)->i_disksize = inode->i_size;
 	err = ext4_add_nondir(handle, dentry, inode);

Index: linux-2.6.24/fs/ext4/ialloc.c
===================================================================

fs/ext4/ialloc.c +1 -2
@@ -744,7 +744,7 @@ got:
 		ext4_std_error(sb, err);
 		goto fail_free_drop;
 	}
-	if (test_opt(sb, EXTENTS)) {
+	if (test_opt(sb, EXTENTS) && !S_ISLNK(mode)) {
 		EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL;
 		ext4_ext_tree_init(handle, inode);
 		err = ext4_update_incompat_feature(handle, sb,
 
-

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