#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/mm.h>
-#include <linux/smp_lock.h>
#ifdef HAVE_SELINUX_IS_ENABLED
#include <linux/selinux.h>
#endif
!(sbi->ll_flags & LL_SBI_ACL))
return -EOPNOTSUPP;
- if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled())
- return -EOPNOTSUPP;
if (xattr_type == XATTR_USER_T && !(sbi->ll_flags & LL_SBI_USER_XATTR))
return -EOPNOTSUPP;
if (xattr_type == XATTR_TRUSTED_T && !cfs_capable(CFS_CAP_SYS_ADMIN))
strcmp(name, "security.capability") == 0))
RETURN(0);
+ /* LU-549: Disable security.selinux when selinux is disabled */
+ if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
+ strcmp(name, "security.selinux") == 0)
+ RETURN(-EOPNOTSUPP);
+
#ifdef CONFIG_FS_POSIX_ACL
if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
(xattr_type == XATTR_ACL_ACCESS_T ||
strcmp(name, "security.capability") == 0))
RETURN(-ENODATA);
+ /* LU-549: Disable security.selinux when selinux is disabled */
+ if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
+ strcmp(name, "security.selinux") == 0)
+ RETURN(-EOPNOTSUPP);
+
#ifdef CONFIG_FS_POSIX_ACL
if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
(xattr_type == XATTR_ACL_ACCESS_T ||
struct ll_inode_info *lli = ll_i2info(inode);
struct posix_acl *acl;
- cfs_spin_lock(&lli->lli_lock);
- acl = posix_acl_dup(lli->lli_posix_acl);
- cfs_spin_unlock(&lli->lli_lock);
+ spin_lock(&lli->lli_lock);
+ acl = posix_acl_dup(lli->lli_posix_acl);
+ spin_unlock(&lli->lli_lock);
if (!acl)
RETURN(-ENODATA);