ext4: fix use-after-free read in ext4_find_extent for bigalloc + inline
[linux-2.6-microblaze.git] / fs / ext4 / extents.c
index e79c767..35703dc 100644 (file)
@@ -5795,7 +5795,8 @@ int ext4_clu_mapped(struct inode *inode, ext4_lblk_t lclu)
         * mapped - no physical clusters have been allocated, and the
         * file has no extents
         */
-       if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA))
+       if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) ||
+           ext4_has_inline_data(inode))
                return 0;
 
        /* search for the extent closest to the first block in the cluster */