[PATCH v2 15/28] debugfs: handle inline_data feature in bmap command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zheng Liu <wenqing.lz@xxxxxxxxxx>

No physical block mapping if an inode has inline data.

Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
Signed-off-by: Zheng Liu <wenqing.lz@xxxxxxxxxx>
---
 lib/ext2fs/bmap.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/ext2fs/bmap.c b/lib/ext2fs/bmap.c
index 5074587..0d043bd 100644
--- a/lib/ext2fs/bmap.c
+++ b/lib/ext2fs/bmap.c
@@ -273,6 +273,13 @@ errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
 		block_buf = buf;
 	}
 
+	/*
+	 * If an inode has inline data, that means that it doesn't have
+	 * any blocks and we shouldn't map any blocks for it.
+	 */
+	if (inode->i_flags & EXT4_INLINE_DATA_FL)
+		goto done;
+
 	if (inode->i_flags & EXT4_EXTENTS_FL) {
 		retval = ext2fs_extent_open2(fs, ino, inode, &handle);
 		if (retval)
-- 
1.7.9.7

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux