Whamcloud - gitweb
Revert "b=22637 MDS returns OBD_MD_FLSIZE to client only when no OSS object allocated"
[fs/lustre-release.git] / lustre / mdt / mdt_handler.c
index 6c63afd..21ac436 100644 (file)
@@ -402,23 +402,18 @@ void mdt_pack_attr2body(struct mdt_thread_info *info, struct mdt_body *b,
 {
         struct md_attr          *ma  = &info->mti_attr;
 
-        LASSERT(ma->ma_valid & MA_INODE);
-
         /*XXX should pack the reply body according to lu_valid*/
         b->valid |= OBD_MD_FLCTIME | OBD_MD_FLUID   |
                     OBD_MD_FLGID   | OBD_MD_FLTYPE  |
                     OBD_MD_FLMODE  | OBD_MD_FLNLINK | OBD_MD_FLFLAGS |
                     OBD_MD_FLATIME | OBD_MD_FLMTIME ;
 
-        if (!S_ISREG(attr->la_mode)) {
+        if (!S_ISREG(attr->la_mode))
                 b->valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | OBD_MD_FLRDEV;
-        } else if (ma->ma_need & MA_LOV && ma->ma_lmm_size == 0) {
-                /* means no objects are allocated on osts. */
-                LASSERT(!(ma->ma_valid & MA_LOV));
-                LASSERT(attr->la_blocks == 0);
-                /* if no object is allocated on osts, the size on mds is valid. b=22272 */
-                b->valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
-        }
+
+        /* if no object is allocated on osts, the size on mds is valid. b=22272 */
+        if (ma->ma_lmm_size == 0)
+                b->valid |= OBD_MD_FLSIZE;
 
         b->atime      = attr->la_atime;
         b->mtime      = attr->la_mtime;