Whamcloud - gitweb
LU-1866 misc: fix some issues found during LFSCK
[fs/lustre-release.git] / lustre / mdt / mdt_lib.c
index a9a962f..051421b 100644 (file)
@@ -573,10 +573,10 @@ int mdt_fix_reply(struct mdt_thread_info *info)
         acl_size = body->aclsize;
 
         /* this replay - not send info to client */
         acl_size = body->aclsize;
 
         /* this replay - not send info to client */
-        if (info->mti_spec.no_create == 1) {
-                md_size = 0;
-                acl_size = 0;
-        }
+       if (info->mti_spec.no_create) {
+               md_size = 0;
+               acl_size = 0;
+       }
 
         CDEBUG(D_INFO, "Shrink to md_size = %d cookie/acl_size = %d"
                         " MDSCAPA = %llx, OSSCAPA = %llx\n",
 
         CDEBUG(D_INFO, "Shrink to md_size = %d cookie/acl_size = %d"
                         " MDSCAPA = %llx, OSSCAPA = %llx\n",
@@ -786,8 +786,8 @@ static __u64 mdt_attr_valid_xlate(__u64 in, struct mdt_reint_record *rr,
         if (in & ATTR_KILL_SGID)
                 out |= LA_KILL_SGID;
 
         if (in & ATTR_KILL_SGID)
                 out |= LA_KILL_SGID;
 
-        if (in & MDS_OPEN_OWNEROVERRIDE)
-                ma->ma_attr_flags |= MDS_OPEN_OWNEROVERRIDE;
+       if (in & MDS_OPEN_OWNEROVERRIDE)
+               ma->ma_attr_flags |= MDS_OWNEROVERRIDE;
 
         if (in & ATTR_FORCE)
                 ma->ma_attr_flags |= MDS_PERM_BYPASS;
 
         if (in & ATTR_FORCE)
                 ma->ma_attr_flags |= MDS_PERM_BYPASS;
@@ -839,6 +839,11 @@ static int mdt_setattr_unpack_rec(struct mdt_thread_info *info)
         la->la_mtime = rec->sa_mtime;
         ma->ma_valid = MA_INODE;
 
         la->la_mtime = rec->sa_mtime;
         ma->ma_valid = MA_INODE;
 
+       if (rec->sa_bias & MDS_DATA_MODIFIED)
+               ma->ma_attr_flags |= MDS_DATA_MODIFIED;
+       else
+               ma->ma_attr_flags &= ~MDS_DATA_MODIFIED;
+
         if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
                 mdt_set_capainfo(info, 0, rr->rr_fid1,
                                  req_capsule_client_get(pill, &RMF_CAPA1));
         if (req_capsule_get_size(pill, &RMF_CAPA1, RCL_CLIENT))
                 mdt_set_capainfo(info, 0, rr->rr_fid1,
                                  req_capsule_client_get(pill, &RMF_CAPA1));
@@ -949,8 +954,8 @@ static int mdt_create_unpack(struct mdt_thread_info *info)
         attr->la_ctime = rec->cr_time;
         attr->la_mtime = rec->cr_time;
         attr->la_atime = rec->cr_time;
         attr->la_ctime = rec->cr_time;
         attr->la_mtime = rec->cr_time;
         attr->la_atime = rec->cr_time;
-        attr->la_valid = LA_MODE | LA_RDEV | LA_UID | LA_GID |
-                         LA_CTIME | LA_MTIME | LA_ATIME;
+       attr->la_valid = LA_MODE | LA_RDEV | LA_UID | LA_GID | LA_TYPE |
+                        LA_CTIME | LA_MTIME | LA_ATIME;
         memset(&sp->u, 0, sizeof(sp->u));
         sp->sp_cr_flags = get_mrc_cr_flags(rec);
 
         memset(&sp->u, 0, sizeof(sp->u));
         sp->sp_cr_flags = get_mrc_cr_flags(rec);