]> git.baikalelectronics.ru Git - kernel.git/commit
BTRFS: Establish i_ops before calling d_instantiate
authorCasey Schaufler <casey@schaufler-ca.com>
Thu, 15 Dec 2011 15:09:07 +0000 (10:09 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 15 Dec 2011 15:50:38 +0000 (10:50 -0500)
commit08ab5413f27a9bf5275257a485724bd184241853
tree2e78aa71cf3108ce34fc3e97ca1fecfad63047d2
parent576b7f11fa32fff4d55c218a6367ca0df8c42719
BTRFS: Establish i_ops before calling d_instantiate

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: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c