diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 8680f649ea7e..827f2b6175d0 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -195,7 +195,7 @@ check_xattrs(struct inode *inode, struct buffer_head *bh, struct ext4_xattr_entry *e = entry; int err = -EFSCORRUPTED; char *err_str; - + printk(KERN_WARNING "ext_check_xattrs: entered in function\n"); if (bh) { if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || BHDR(bh)->h_blocks != cpu_to_le32(1)) { @@ -251,12 +251,18 @@ check_xattrs(struct inode *inode, struct buffer_head *bh, err_str = "invalid ea_ino"; goto errout; } - if (entry->e_name_index == EXT4_XATTR_INDEX_SYSTEM && - entry->e_name_len == 4 && - !memcmp(entry->e_name,"data", 4) && - ea_ino != 0) { + if (ext4_has_inline_data(inode) && ea_ino != 0) { err_str = "system.data xattr cannot use external inode storage"; - goto errout; + goto errout; + } + if (entry->e_name_index == EXT4_XATTR_INDEX_SYSTEM && + entry->e_name_len == 4 && + !memcmp(entry->e_name, "data", 4)) { + printk(KERN_ERR "Found system.data xattr: ea_ino=%lu\n", ea_ino); + if (ext4_has_inline_data(inode) && ea_ino != 0) { + err_str = "system.data xattr cannot use external inode storage"; + goto errout; + } } if (size > EXT4_XATTR_SIZE_MAX) { err_str = "e_value size too large";