• Casey Schaufler's avatar
    BTRFS: Establish i_ops before calling d_instantiate · ad19db71
    Casey Schaufler authored
    The Smack LSM hook for security_d_instantiate checks
    the inode's i_op->getxattr value to determine if the
    containing filesystem supports extended attributes.
    The BTRFS filesystem sets the inode's i_op value only
    after it has instantiated the inode. This results in
    Smack incorrectly giving new BTRFS inodes attributes
    from the filesystem defaults on the assumption that
    values can't be stored on the filesystem. This patch
    moves the assignment of inode operation vectors ahead
    of the calls to d_instantiate, letting Smack know that
    the filesystem supports extended attributes. There
    should be no impact on the performance or behavior of
    BTRFS.
    Signed-off-by: default avatarCasey Schaufler <casey@schaufler-ca.com>
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    ad19db71
inode.c 196 KB