Use ext4_inode_is_fast_symlink() in ext2fs_inode_has_valid_blocks2()
instead of depending exclusively on i_blocks == 0 to determine
if an inode is a fast symlink. Otherwise, if a fast symlink has a
large external xattr inode that increases i_blocks, it will be
incorrectly reported as having invalid blocks.
Change-Id: Ibde2348da39401601abedd603bd7e4ef97091abe
Fixes: 0684a4f33 ("Overhaul extended attribute handling")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/59871
Lustre-bug-id: https://jira.whamcloud.com/browse/LU-19121
Message-ID: <
20250808080505.
1307694-1-adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/* With no EA block, we can rely on i_blocks */
if (inode->i_blocks == 0)
return 0;
+ return !ext2fs_is_fast_symlink(inode);
} else {
/* With an EA block, life gets more tricky */
if (inode->i_size >= EXT2_N_BLOCKS*4)
--- /dev/null
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 14/256 files (0.0% non-contiguous), 1147/8192 blocks
+Exit status is 0
--- /dev/null
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 14/256 files (0.0% non-contiguous), 1147/8192 blocks
+Exit status is 0
--- /dev/null
+fast symlink with ea_inode