Whamcloud - gitweb
LU-7186 lod: do not propagate size if stripeless 43/16743/6
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Wed, 7 Oct 2015 08:21:03 +0000 (11:21 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 28 Oct 2015 13:51:57 +0000 (13:51 +0000)
if a file has no stripes, but the size isn't zero,
then do not try to propagate this size to stripes.

Change-Id: I25401bcc41e3ea84a2b9158120f1e907af47fafa
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/16743
Reviewed-by: Frank Zago <fzago@cray.com>
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_object.c
lustre/tests/sanity-hsm.sh

index 9e3e800..c2313c3 100644 (file)
@@ -3373,6 +3373,9 @@ static int lod_declare_init_size(const struct lu_env *env,
        LASSERT(lo->ldo_stripe || lo->ldo_stripenr == 0);
        LASSERT(lo->ldo_stripe_size > 0);
 
+       if (lo->ldo_stripenr == 0)
+               RETURN(0);
+
        rc = dt_attr_get(env, next, attr);
        LASSERT(attr->la_valid & LA_SIZE);
        if (rc)
index b8ae8da..0126b78 100755 (executable)
@@ -3032,6 +3032,19 @@ test_58() {
 }
 run_test 58 "Truncate a released file will trigger restore"
 
+test_59() {
+       local fid
+       copytool_setup
+       $MCREATE $DIR/$tfile || error "mcreate failed"
+       $TRUNCATE $DIR/$tfile 42 || error "truncate failed"
+       $LFS hsm_archive $DIR/$tfile || error "archive request failed"
+       fid=$(path2fid $DIR/$tfile)
+       wait_request_state $fid ARCHIVE SUCCEED
+       $LFS hsm_release $DIR/$tfile || error "release failed"
+       copytool_cleanup
+}
+run_test 59 "Release stripeless file with non-zero size"
+
 test_60() {
        # This test validates the fix for LU-4512. Ensure that the -u
        # option changes the progress reporting interval from the