Whamcloud - gitweb
LU-166 NOT assert wire data from client for getattr-by-fid
[fs/lustre-release.git] / lustre / mdt / mdt_lib.c
index 07ce5ab..9e64d59 100644 (file)
@@ -742,10 +742,16 @@ static __u64 mdt_attr_valid_xlate(__u64 in, struct mdt_reint_record *rr,
         if (in & ATTR_ATTR_FLAG)
                 out |= LA_FLAGS;
 
+        if (in & ATTR_KILL_SUID)
+                out |= LA_KILL_SUID;
+
+        if (in & ATTR_KILL_SGID)
+                out |= LA_KILL_SGID;
+
         if (in & MDS_OPEN_OWNEROVERRIDE)
                 ma->ma_attr_flags |= MDS_OPEN_OWNEROVERRIDE;
 
-        if (in & (ATTR_KILL_SUID|ATTR_KILL_SGID))
+        if (in & ATTR_FORCE)
                 ma->ma_attr_flags |= MDS_PERM_BYPASS;
 
         /*XXX need ATTR_RAW?*/
@@ -903,7 +909,7 @@ static int mdt_create_unpack(struct mdt_thread_info *info)
         attr->la_valid = LA_MODE | LA_RDEV | LA_UID | LA_GID |
                          LA_CTIME | LA_MTIME | LA_ATIME;
         memset(&sp->u, 0, sizeof(sp->u));
-        sp->sp_cr_flags = rec->cr_flags;
+        sp->sp_cr_flags = get_mrc_cr_flags(rec);
         sp->sp_ck_split = !!(rec->cr_bias & MDS_CHECK_SPLIT);
         info->mti_cross_ref = !!(rec->cr_bias & MDS_CROSS_REF);
 
@@ -914,7 +920,8 @@ static int mdt_create_unpack(struct mdt_thread_info *info)
 
         if (!info->mti_cross_ref) {
                 rr->rr_name = req_capsule_client_get(pill, &RMF_NAME);
-                rr->rr_namelen = req_capsule_get_size(pill, &RMF_NAME, RCL_CLIENT) - 1;
+                rr->rr_namelen = req_capsule_get_size(pill, &RMF_NAME,
+                                                      RCL_CLIENT) - 1;
                 LASSERT(rr->rr_name && rr->rr_namelen > 0);
         } else {
                 rr->rr_name = NULL;
@@ -1172,7 +1179,7 @@ static int mdt_open_unpack(struct mdt_thread_info *info)
         attr->la_valid = LA_MODE  | LA_RDEV  | LA_UID   | LA_GID |
                          LA_CTIME | LA_MTIME | LA_ATIME;
         memset(&info->mti_spec.u, 0, sizeof(info->mti_spec.u));
-        info->mti_spec.sp_cr_flags = rec->cr_flags;
+        info->mti_spec.sp_cr_flags = get_mrc_cr_flags(rec);
         /* Do not trigger ASSERTION if client miss to set such flags. */
         if (unlikely(info->mti_spec.sp_cr_flags == 0))
                 RETURN(-EPROTO);