From: Andreas Gruenbacher When a new inode is created, ext3_new_inode sets the EXT3_STATE_NEW flag, which tells ext3_do_update_inode to zero out the inode before filling in the inode's data. When a file is created in a directory with a default acl, the new inode inherits the directory's default acl; this generates attributes. The attributes are created before ext3_do_update_inode is called to write out the inode. In case of in-inode attributes, the new inode's attributes are written, and then zeroed out again by ext3_do_update_inode. Bad thing. Fix this by recognizing the EXT3_STATE_NEW case in ext3_xattr_set_handle, and zeroing out the inode there already when necessary. Signed-off-by: Andreas Gruenbacher Signed-off-by: Andrew Morton --- 25-akpm/fs/ext3/xattr.c | 7 +++++++ 1 files changed, 7 insertions(+) diff -puN fs/ext3/xattr.c~ext3-fix-ea-in-inode-default-acl-creation fs/ext3/xattr.c --- 25/fs/ext3/xattr.c~ext3-fix-ea-in-inode-default-acl-creation 2005-01-23 14:46:36.216812760 -0800 +++ 25-akpm/fs/ext3/xattr.c 2005-01-23 14:46:36.220812152 -0800 @@ -958,6 +958,13 @@ ext3_xattr_set_handle(handle_t *handle, error = ext3_get_inode_loc(inode, &is.iloc); if (error) goto cleanup; + + if (EXT3_I(inode)->i_state & EXT3_STATE_NEW) { + struct ext3_inode *raw_inode = ext3_raw_inode(&is.iloc); + memset(raw_inode, 0, EXT3_SB(inode->i_sb)->s_inode_size); + EXT3_I(inode)->i_state &= ~EXT3_STATE_NEW; + } + error = ext3_xattr_ibody_find(inode, &i, &is); if (error) goto cleanup; _