Skip to contentSkip to conversation

Patch "ext4: support fast symlinks from ext3 file systems" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Dec 18, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ext4: support fast symlinks from ext3 file systems

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ext4-support-fast-symlinks-from-ext3-file-systems.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From fc82228a5e3860502dbf3bfa4a9570cb7093cf7f Mon Sep 17 00:00:00 2001

From: Andi Kleen <[email protected]>
Date: Sun, 3 Dec 2017 20:38:01 -0500
Subject: ext4: support fast symlinks from ext3 file systems

From: Andi Kleen <[email protected]>

commit fc82228a5e3860502dbf3bfa4a9570cb7093cf7f upstream.

407cd7fb83c0 (ext4: change fast symlink test to not rely on i_blocks) broke ~10 years old ext3 file systems created by 2.6.17. Any ELF executable fails because the /lib/ld-linux.so.2 fast symlink cannot be read anymore.

The patch assumed fast symlinks were created in a specific way, but that's not true on these really old file systems.

The new behavior is apparently needed only with the large EA inode feature.

Revert to the old behavior if the large EA inode feature is not set.

This makes my old VM boot again.

Fixes 407cd7fb83c0 (ext4: change fast symlink test to not rely on i_blocks)
---
 fs/ext4/inode.c |    9 +++++++++
 1 file changed, 9 insertions(+)
fs/ext4/inode.c +9 -0
@@ -149,6 +149,15 @@ static int ext4_meta_trans_blocks(struct
  */
 int ext4_inode_is_fast_symlink(struct inode *inode)
 {
+	if (!(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)) {
+		int ea_blocks = EXT4_I(inode)->i_file_acl ?
+				EXT4_CLUSTER_SIZE(inode->i_sb) >> 9 : 0;
+
+		if (ext4_has_inline_data(inode))
+			return 0;
+
+		return (S_ISLNK(inode->i_mode) && inode->i_blocks - ea_blocks == 0);
+	}
 	return S_ISLNK(inode->i_mode) && inode->i_size &&
 	       (inode->i_size < EXT4_N_BLOCKS * 4);
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/x86-boot-compressed-64-print-error-if-5-level-paging-is-not-supported.patch queue-4.14/x86-boot-compressed-64-detect-and-handle-5-level-paging-at-boot-time.patch queue-4.14/ext4-support-fast-symlinks-from-ext3-file-systems.patch