Whamcloud - gitweb
LU-15216 lmv: improve MDT QOS space balance
[fs/lustre-release.git] / lustre / llite / dir.c
index ad94e5a..4006417 100644 (file)
@@ -511,7 +511,7 @@ static int ll_dir_setdirstripe(struct dentry *dparent, struct lmv_user_md *lump,
        if (IS_ERR(op_data))
                RETURN(PTR_ERR(op_data));
 
-       op_data->op_dir_depth = ll_i2info(parent)->lli_depth;
+       op_data->op_dir_depth = ll_i2info(parent)->lli_dir_depth;
 
        if (ll_sbi_has_encrypt(sbi) &&
            (IS_ENCRYPTED(parent) ||
@@ -1847,7 +1847,11 @@ out_rmdir:
                        st.st_uid       = body->mbo_uid;
                        st.st_gid       = body->mbo_gid;
                        st.st_rdev      = body->mbo_rdev;
-                       st.st_size      = body->mbo_size;
+                       if (llcrypt_require_key(inode) == -ENOKEY)
+                               st.st_size = round_up(st.st_size,
+                                                  LUSTRE_ENCRYPTION_UNIT_SIZE);
+                       else
+                               st.st_size = body->mbo_size;
                        st.st_blksize   = PAGE_SIZE;
                        st.st_blocks    = body->mbo_blocks;
                        st.st_atime     = body->mbo_atime;
@@ -1870,7 +1874,11 @@ out_rmdir:
                        stx.stx_mode = body->mbo_mode;
                        stx.stx_ino = cl_fid_build_ino(&body->mbo_fid1,
                                                       api32);
-                       stx.stx_size = body->mbo_size;
+                       if (llcrypt_require_key(inode) == -ENOKEY)
+                               stx.stx_size = round_up(stx.stx_size,
+                                                  LUSTRE_ENCRYPTION_UNIT_SIZE);
+                       else
+                               stx.stx_size = body->mbo_size;
                        stx.stx_blocks = body->mbo_blocks;
                        stx.stx_atime.tv_sec = body->mbo_atime;
                        stx.stx_ctime.tv_sec = body->mbo_ctime;