• Andreas Gruenbacher's avatar
    [PATCH] ext3: fix ea-in-inode default ACL creation · ce9be3ce
    Andreas Gruenbacher authored
    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: default avatarAndreas Gruenbacher <agruen@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    ce9be3ce
xattr.c 34.2 KB