Whamcloud - gitweb
LU-6373 llite: default dir stripe index only for mkdir 96/14096/2
authorwang di <di.wang@intel.com>
Thu, 12 Mar 2015 14:13:42 +0000 (07:13 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 27 Mar 2015 15:31:01 +0000 (15:31 +0000)
Default dir stripe index should only work during mkdir,
otherwise it will cause other open/create request being
sent to the wrong MDT.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Id95d7218196d52950eceea38be5612ffe4a6b080
Reviewed-on: http://review.whamcloud.com/14096
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/llite_lib.c
lustre/tests/sanity.sh

index ea3620d..668a719 100644 (file)
@@ -2505,8 +2505,9 @@ struct md_op_data * ll_prep_md_op_data(struct md_op_data *op_data,
        op_data->op_default_stripe_offset = -1;
        if (S_ISDIR(i1->i_mode)) {
                op_data->op_mea1 = ll_i2info(i1)->lli_lsm_md;
-               op_data->op_default_stripe_offset =
-                          ll_i2info(i1)->lli_def_stripe_offset;
+               if (opc == LUSTRE_OPC_MKDIR)
+                       op_data->op_default_stripe_offset =
+                                  ll_i2info(i1)->lli_def_stripe_offset;
        }
 
        if (i2) {
index d76aa06..a458bf5 100644 (file)
@@ -13179,6 +13179,9 @@ test_300_check_default_striped_dir()
 
        mkdir $DIR/$tdir/$dirname/{test1,test2,test3,test4} ||
                                                error "create dirs failed"
+
+       createmany -o $DIR/$tdir/$dirname/f- 10 || error "create files failed"
+       unlinkmany $DIR/$tdir/$dirname/f- 10    || error "unlink files failed"
        for dir in $(find $DIR/$tdir/$dirname/*); do
                stripe_count=$($LFS getdirstripe -c $dir)
                [ $stripe_count -eq $default_count ] ||