• Omar Sandoval's avatar
    btrfs: reserve correct number of items for inode creation · 3538d68d
    Omar Sandoval authored
    The various inode creation code paths do not account for the compression
    property, POSIX ACLs, or the parent inode item when starting a
    transaction. Fix it by refactoring all of these code paths to use a new
    function, btrfs_new_inode_prepare(), which computes the correct number
    of items. To do so, it needs to know whether POSIX ACLs will be created,
    so move the ACL creation into that function. To reduce the number of
    arguments that need to be passed around for inode creation, define
    struct btrfs_new_inode_args containing all of the relevant information.
    
    btrfs_new_inode_prepare() will also be a good place to set up the
    fscrypt context and encrypted filename in the future.
    Reviewed-by: default avatarSweet Tea Dorminy <sweettea-kernel@dorminy.me>
    Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    3538d68d
ioctl.c 140 KB