+test_247a() {
+ lctl get_param -n mdc.$FSNAME-MDT0000*.import |
+ grep -q subtree ||
+ { skip "Fileset feature is not supported"; return; }
+
+ local submount=${MOUNT}_$tdir
+
+ mkdir $MOUNT/$tdir
+ mkdir -p $submount || error "mkdir $submount failed"
+ FILESET="$FILESET/$tdir" mount_client $submount ||
+ error "mount $submount failed"
+ echo foo > $submount/$tfile || error "write $submount/$tfile failed"
+ [ $(cat $MOUNT/$tdir/$tfile) = "foo" ] ||
+ error "read $MOUNT/$tdir/$tfile failed"
+ umount_client $submount || error "umount $submount failed"
+ rmdir $submount
+}
+run_test 247a "mount subdir as fileset"
+
+test_247b() {
+ lctl get_param -n mdc.$FSNAME-MDT0000*.import | grep -q subtree ||
+ { skip "Fileset feature is not supported"; return; }
+
+ local submount=${MOUNT}_$tdir
+
+ rm -rf $MOUNT/$tdir
+ mkdir -p $submount || error "mkdir $submount failed"
+ SKIP_FILESET=1
+ FILESET="$FILESET/$tdir" mount_client $submount &&
+ error "mount $submount should fail"
+ rmdir $submount
+}
+run_test 247b "mount subdir that dose not exist"
+
+test_247c() {
+ lctl get_param -n mdc.$FSNAME-MDT0000*.import | grep -q subtree ||
+ { skip "Fileset feature is not supported"; return; }
+
+ local submount=${MOUNT}_$tdir
+
+ mkdir -p $MOUNT/$tdir/dir1
+ mkdir -p $submount || error "mkdir $submount failed"
+ FILESET="$FILESET/$tdir" mount_client $submount ||
+ error "mount $submount failed"
+ local fid=$($LFS path2fid $MOUNT/)
+ $LFS fid2path $submount $fid && error "fid2path should fail"
+ umount_client $submount || error "umount $submount failed"
+ rmdir $submount
+}
+run_test 247c "running fid2path outside root"
+
+test_247d() {
+ lctl get_param -n mdc.$FSNAME-MDT0000*.import | grep -q subtree ||
+ { skip "Fileset feature is not supported"; return; }
+
+ local submount=${MOUNT}_$tdir
+
+ mkdir -p $MOUNT/$tdir/dir1
+ mkdir -p $submount || error "mkdir $submount failed"
+ FILESET="$FILESET/$tdir" mount_client $submount ||
+ error "mount $submount failed"
+ local fid=$($LFS path2fid $submount/dir1)
+ $LFS fid2path $submount $fid || error "fid2path should succeed"
+ umount_client $submount || error "umount $submount failed"
+ rmdir $submount
+}
+run_test 247d "running fid2path inside root"
+
+# LU-8037
+test_247e() {
+ lctl get_param -n mdc.$FSNAME-MDT0000*.import |
+ grep -q subtree ||
+ { skip "Fileset feature is not supported"; return; }
+
+ local submount=${MOUNT}_$tdir
+
+ mkdir $MOUNT/$tdir
+ mkdir -p $submount || error "mkdir $submount failed"
+ FILESET="$FILESET/.." mount_client $submount &&
+ error "mount $submount should fail"
+ rmdir $submount
+}
+run_test 247e "mount .. as fileset"
+