Whamcloud - gitweb
LU-14739 quota: nodemap squashed root cannot bypass quota
[fs/lustre-release.git] / lustre / mdt / mdt_som.c
index fa3f033..62c52a5 100644 (file)
@@ -85,21 +85,21 @@ int mdt_get_som(struct mdt_thread_info *info, struct mdt_object *obj,
 
                ma->ma_valid |= MA_SOM;
 
-               if ((som->ms_valid & SOM_FL_STRICT)) {
+               CDEBUG(D_INODE, DFID": Reading som attrs: "
+                      "valid: %x, size: %lld, blocks: %lld\n",
+                      PFID(mdt_object_fid(obj)), som->ms_valid,
+                      som->ms_size, som->ms_blocks);
+
+               if (som->ms_valid & SOM_FL_STRICT) {
                        attr->la_valid |= LA_SIZE | LA_BLOCKS;
-                       attr->la_size = som->ms_size;
-                       attr->la_blocks = som->ms_blocks;
 
                        /*
                         * Size on MDS is valid and could be returned
                         * to client.
                         */
+                       attr->la_size = som->ms_size;
+                       attr->la_blocks = som->ms_blocks;
                        info->mti_som_valid = 1;
-
-                       CDEBUG(D_INODE, DFID": Reading som attrs: "
-                              "valid: %x, size: %lld, blocks: %lld\n",
-                              PFID(mdt_object_fid(obj)), som->ms_valid,
-                              som->ms_size, som->ms_blocks);
                }
        } else if (rc == -ENODATA) {
                rc = 0;
@@ -218,7 +218,7 @@ int mdt_lsom_update(struct mdt_thread_info *info,
         * MDS only updates LSOM of the file if the size or block
         * size is being increased or the file is being truncated.
         */
-       if (mdt_lmm_dom_entry(info->mti_big_lmm) != LMM_DOM_ONLY &&
+       if (!mdt_lmm_dom_only(info->mti_big_lmm) &&
            !(tmp_ma->ma_valid & MA_INODE && tmp_ma->ma_attr.la_nlink == 0)) {
                __u64 size;
                __u64 blocks;