Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / mdt / mdt_xattr.c
index 5a93bfe..561a395 100644 (file)
@@ -280,8 +280,6 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
 {
         struct ptlrpc_request   *req = mdt_info_req(info);
         struct md_ucred         *uc  = mdt_ucred(info);
-        const char               user_string[] = "user.";
-        const char               trust_string[] = "trusted.";
         struct mdt_lock_handle  *lh;
         struct req_capsule      *pill = info->mti_pill;
         const struct lu_env     *env  = info->mti_env;
@@ -330,13 +328,19 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
         if (!xattr_name)
                 GOTO(out, rc = err_serious(-EFAULT));
 
-        if (strncmp(xattr_name, trust_string, sizeof(trust_string) - 1) == 0) {
-                if (strcmp(xattr_name + 8, XATTR_NAME_LOV) == 0)
+        if (strncmp(xattr_name, XATTR_USER_PREFIX,
+                    sizeof(XATTR_USER_PREFIX) - 1) == 0) {
+                if (strcmp(xattr_name, XATTR_NAME_LOV) == 0)
                         GOTO(out, rc = -EACCES);
+                if (strcmp(xattr_name, XATTR_NAME_LMA) == 0)
+                        GOTO(out, rc = 0);
+                if (strcmp(xattr_name, XATTR_NAME_LINK) == 0)
+                        GOTO(out, rc = 0);
         }
 
         if (!(req->rq_export->exp_connect_flags & OBD_CONNECT_XATTR) &&
-            (strncmp(xattr_name, user_string, sizeof(user_string) - 1) == 0)) {
+            (strncmp(xattr_name, XATTR_USER_PREFIX,
+                     sizeof(XATTR_USER_PREFIX) - 1) == 0)) {
                 GOTO(out, rc = -EOPNOTSUPP);
         }