Whamcloud - gitweb
debugfs: do not display fast symlink with inline data
authorZheng Liu <wenqing.lz@taobao.com>
Mon, 2 Jun 2014 11:40:41 +0000 (19:40 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 2 Jun 2014 14:57:20 +0000 (10:57 -0400)
After enabling symlink with inline data, stat command in debugfs will
think an inode is a fast symlink.  This patch fixes this issue.

Cc: Ian Nartowicz <claws@nartowicz.co.uk>
Cc: Tao Ma <tm@tao.ma>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c

index 23a7ca3..2147ffa 100644 (file)
@@ -784,7 +784,9 @@ void internal_dump_inode(FILE *out, const char *prefix,
                fprintf(out, "Inode checksum: 0x%08x\n", crc);
        }
 
-       if (LINUX_S_ISLNK(inode->i_mode) && ext2fs_inode_data_blocks(current_fs,inode) == 0)
+       if (LINUX_S_ISLNK(inode->i_mode) &&
+           ext2fs_inode_data_blocks(current_fs,inode) == 0 &&
+           !(inode->i_flags & EXT4_INLINE_DATA_FL))
                fprintf(out, "%sFast_link_dest: %.*s\n", prefix,
                        (int) inode->i_size, (char *)inode->i_block);
        else if (LINUX_S_ISBLK(inode->i_mode) || LINUX_S_ISCHR(inode->i_mode)) {