Whamcloud - gitweb
LU-12262 llite: harden ll_sbi ll_flags
[fs/lustre-release.git] / lustre / llite / xattr.c
index 779e6e0..ca45354 100644 (file)
@@ -76,11 +76,11 @@ static int xattr_type_filter(struct ll_sb_info *sbi,
 
        if ((handler->flags == XATTR_ACL_ACCESS_T ||
             handler->flags == XATTR_ACL_DEFAULT_T) &&
-           !(sbi->ll_flags & LL_SBI_ACL))
+           !test_bit(LL_SBI_ACL, sbi->ll_flags))
                 return -EOPNOTSUPP;
 
        if (handler->flags == XATTR_USER_T &&
-           !(sbi->ll_flags & LL_SBI_USER_XATTR))
+           !test_bit(LL_SBI_USER_XATTR, sbi->ll_flags))
                return -EOPNOTSUPP;
 
        if (handler->flags == XATTR_TRUSTED_T &&
@@ -167,7 +167,7 @@ static int ll_xattr_set_common(const struct xattr_handler *handler,
        if (rc) {
                if (rc == -EOPNOTSUPP && handler->flags == XATTR_USER_T) {
                        LCONSOLE_INFO("Disabling user_xattr feature because it is not supported on the server\n");
-                       sbi->ll_flags &= ~LL_SBI_USER_XATTR;
+                       clear_bit(LL_SBI_USER_XATTR, sbi->ll_flags);
                }
                RETURN(rc);
        }
@@ -442,7 +442,7 @@ out_xattr:
                LCONSOLE_INFO("%s: disabling user_xattr feature because "
                              "it is not supported on the server: rc = %d\n",
                              sbi->ll_fsname, rc);
-               sbi->ll_flags &= ~LL_SBI_USER_XATTR;
+               clear_bit(LL_SBI_USER_XATTR, sbi->ll_flags);
        }
 out:
         ptlrpc_req_finished(req);