Whamcloud - gitweb
LU-1812 ext4: ec_type has been dropped from ext4_ext_cache
[fs/lustre-release.git] / lustre / mdt / mdt_xattr.c
index d1915d7..6164810 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -69,9 +69,9 @@ static int mdt_getxattr_pack_reply(struct mdt_thread_info * info)
                 if (!xattr_name)
                         RETURN(-EFAULT);
 
-                if (!(req->rq_export->exp_connect_flags & OBD_CONNECT_XATTR) &&
-                    !strncmp(xattr_name, user_string, sizeof(user_string) - 1))
-                        RETURN(-EOPNOTSUPP);
+               if (!(exp_connect_flags(req->rq_export) & OBD_CONNECT_XATTR) &&
+                   !strncmp(xattr_name, user_string, sizeof(user_string) - 1))
+                       RETURN(-EOPNOTSUPP);
 
                 size = mo_xattr_get(info->mti_env,
                                     mdt_object_child(info->mti_object),
@@ -312,8 +312,8 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
 
         if (strncmp(xattr_name, XATTR_USER_PREFIX,
                     sizeof(XATTR_USER_PREFIX) - 1) == 0) {
-                if (!(req->rq_export->exp_connect_flags & OBD_CONNECT_XATTR))
-                        GOTO(out, rc = -EOPNOTSUPP);
+               if (!(exp_connect_flags(req->rq_export) & OBD_CONNECT_XATTR))
+                       GOTO(out, rc = -EOPNOTSUPP);
                 if (strcmp(xattr_name, XATTR_NAME_LOV) == 0)
                         GOTO(out, rc = -EACCES);
                 if (strcmp(xattr_name, XATTR_NAME_LMA) == 0)
@@ -337,8 +337,9 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
          * not change the access permissions of this inode, nor any
          * other existing inodes. It is setting the ACLs inherited
          * by new directories/files at create time. */
+       /* We need revoke both LOOKUP|PERM lock here, see mdt_attr_set. */
         if (!strcmp(xattr_name, XATTR_NAME_ACL_ACCESS))
-                lockpart |= MDS_INODELOCK_LOOKUP;
+               lockpart |= MDS_INODELOCK_PERM | MDS_INODELOCK_LOOKUP;
 
         lh = &info->mti_lh[MDT_LH_PARENT];
         /* ACLs were sent to clients under LCK_CR locks, so taking LCK_EX