Whamcloud - gitweb
libext2fs: add sanity checks for ea_in_inode
[tools/e2fsprogs.git] / lib / ext2fs / alloc.c
index af21410..3fd9216 100644 (file)
@@ -353,10 +353,11 @@ blk64_t ext2fs_find_inode_goal(ext2_filsys fs, ext2_ino_t ino,
        ext2_extent_handle_t    handle = NULL;
        errcode_t               err;
 
-       if (inode == NULL || ext2fs_inode_data_blocks2(fs, inode) == 0)
-               goto no_blocks;
-
-       if (inode->i_flags & EXT4_INLINE_DATA_FL)
+       /* Make sure data stored in inode->i_block is neither fast symlink nor
+        * inline data.
+        */
+       if (inode == NULL || ext2fs_is_fast_symlink(inode) ||
+           inode->i_flags & EXT4_INLINE_DATA_FL)
                goto no_blocks;
 
        if (inode->i_flags & EXT4_EXTENTS_FL) {