Whamcloud - gitweb
LU-10070 lod: SEL inheritance fix 04/35704/3
authorVitaly Fertman <c17818@cray.com>
Wed, 7 Aug 2019 13:48:17 +0000 (16:48 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 21 Aug 2019 05:00:41 +0000 (05:00 +0000)
a sub-dir cannot be created in a dir with a SEL layout template
due to problem layout verification

Fixes: 94e9699878e ("LU-10070 lod: SEL: interoperability support")

Signed-off-by: Vitaly Fertman <c17818@cray.com>
Cray-bug-id: LUS-2528
Change-Id: I2c439e44d8f183f4057f548ee38e530c578371e4
Reviewed-on: https://review.whamcloud.com/35704
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lod/lod_lov.c
lustre/tests/sanity-pfl.sh

index bb8e3cf..c044bd1 100644 (file)
@@ -1013,7 +1013,7 @@ int lod_generate_lovea(const struct lu_env *env, struct lod_object *lo,
                if (lod_comp->llc_flags & LCME_FL_NOSYNC)
                        lcme->lcme_timestamp =
                                cpu_to_le64(lod_comp->llc_timestamp);
-               if (lod_comp->llc_flags & LCME_FL_EXTENSION)
+               if (lod_comp->llc_flags & LCME_FL_EXTENSION && !is_dir)
                        lcm->lcm_magic = cpu_to_le32(LOV_MAGIC_SEL);
 
                lcme->lcme_extent.e_start =
@@ -1345,6 +1345,18 @@ int lod_parse_striping(const struct lu_env *env, struct lod_object *lo,
                                le32_to_cpu(comp_v1->lcm_entries[i].lcme_id);
                        if (lod_comp->llc_id == LCME_ID_INVAL)
                                GOTO(out, rc = -EINVAL);
+
+                       if (comp_v1->lcm_entries[i].lcme_flags &
+                           cpu_to_le32(LCME_FL_EXTENSION) &&
+                           magic != LOV_MAGIC_SEL) {
+                               struct lod_device *d =
+                                       lu2lod_dev(lo->ldo_obj.do_lu.lo_dev);
+
+                               CDEBUG(D_WARNING, "%s: not SEL magic on SEL "
+                                      "file "DFID": %x\n",
+                                      lod2obd(d)->obd_name,
+                                      PFID(lod_object_fid(lo)), magic);
+                       }
                } else {
                        lod_comp_set_init(lod_comp);
                }
index 83ac42b..708b3e2 100644 (file)
@@ -1053,6 +1053,7 @@ test_19b() {
                skip "skipped for lustre < $SEL_VER"
 
        local comp_file=$DIR/$tdir/$tfile
+       local comp_dir=$DIR/$tdir/$tdir
        local flg_opts=""
        local found=""
 
@@ -1060,15 +1061,24 @@ test_19b() {
        $LFS setstripe --ext-size 64M -c 1 -E -1 $DIR/$tdir ||
                error "Setstripe on $DIR/$tdir failed"
 
+       # check inheritance for a sub-dir and a file
+       test_mkdir $comp_dir
+       found=$($LFS find --comp-start 0 -E 64M $comp_dir | wc -l)
+       [ $found -eq 1 ] || error "Dir Inheritance: wrong first component size"
+
+       flg_opts="--comp-flags extension"
+       found=$($LFS find --comp-start 64M -E EOF $flg_opts $comp_dir | wc -l)
+       [ $found -eq 1 ] || error "Dir Inheritance: Second component not found"
+
        touch $comp_file
 
        flg_opts="--comp-flags init"
        found=$($LFS find --comp-start 0 -E 64M $flg_opts $comp_file | wc -l)
-       [ $found -eq 1 ] || error "Inheritance: wrong first component size"
+       [ $found -eq 1 ] || error "File Inheritance: wrong first component size"
 
        flg_opts="--comp-flags extension"
        found=$($LFS find --comp-start 64M -E EOF $flg_opts $comp_file | wc -l)
-       [ $found -eq 1 ] || error "Inheritance: Second component not found"
+       [ $found -eq 1 ] || error "File Inheritance: Second component not found"
 
        test19_io_base $comp_file 1
 }