From: Andreas Gruenbacher Date: Fri, 8 Jul 2005 00:57:00 +0000 (-0700) Subject: [PATCH] ext3 xattr: Don't write to the in-inode xattr space of reserved inodes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff87b37da912d6aeab6c20c58f51b34d3e37f111;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [PATCH] ext3 xattr: Don't write to the in-inode xattr space of reserved inodes We are not using the in-inode space for xattrs in reserved inodes because mkfs.ext3 doesn't initialize it properly. For those inodes, we set i_extra_isize to 0. Make sure that we also don't overwrite the i_extra_isize field when writing out the inode in that case. This is for cleanliness only, and doesn't fix an actual bug. Signed-off-by: Andreas Gruenbacher Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 0b2db4f618c..9989fdcf4d5 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -2663,7 +2663,7 @@ static int ext3_do_update_inode(handle_t *handle, } else for (block = 0; block < EXT3_N_BLOCKS; block++) raw_inode->i_block[block] = ei->i_data[block]; - if (EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) + if (ei->i_extra_isize) raw_inode->i_extra_isize = cpu_to_le16(ei->i_extra_isize); BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");