Whamcloud - gitweb
LU-3441 build: Allow for native KNC compilation
[fs/lustre-release.git] / lustre / mdt / mdt_xattr.c
index 1e2f157..1ba61e5 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, Intel Corporation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -122,7 +122,7 @@ int mdt_getxattr(struct mdt_thread_info *info)
         ENTRY;
 
         LASSERT(info->mti_object != NULL);
-        LASSERT(lu_object_assert_exists(&info->mti_object->mot_obj.mo_lu));
+       LASSERT(lu_object_assert_exists(&info->mti_object->mot_obj));
 
         CDEBUG(D_INODE, "getxattr "DFID"\n", PFID(&info->mti_body->fid1));
 
@@ -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
@@ -353,15 +354,15 @@ int mdt_reint_setxattr(struct mdt_thread_info *info,
         if (rc)
                 GOTO(out_unlock, rc);
 
-        if (unlikely(!(valid & OBD_MD_FLCTIME))) {
-                /* This isn't strictly an error, but all current clients
-                 * should set OBD_MD_FLCTIME when setting attributes. */
-                CWARN("%s: client miss to set OBD_MD_FLCTIME when "
-                      "setxattr %s: [object "DFID"] [valid "LPU64"]\n",
-                      info->mti_exp->exp_obd->obd_name, xattr_name,
-                      PFID(rr->rr_fid1), valid);
-                attr->la_ctime = cfs_time_current_sec();
-        }
+       if (unlikely(!(valid & OBD_MD_FLCTIME))) {
+               /* This isn't strictly an error, but all current clients
+                * should set OBD_MD_FLCTIME when setting attributes. */
+               CWARN("%s: client miss to set OBD_MD_FLCTIME when "
+                     "setxattr %s: [object "DFID"] [valid "LPU64"]\n",
+                     mdt_obd_name(info->mti_mdt), xattr_name,
+                     PFID(rr->rr_fid1), valid);
+               attr->la_ctime = cfs_time_current_sec();
+       }
         attr->la_valid = LA_CTIME;
         child = mdt_object_child(obj);
         if (valid & OBD_MD_FLXATTR) {