Added a check to prevent fid access to the filesystem .lustre
directory from returning EINVAL.
Added a sanity check accordingly.
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I3002e8dd1b834a0b6b87fe707e12573c2accb58c
Reviewed-on: http://review.whamcloud.com/8360
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
GOTO(out, rc = -EINVAL);
}
GOTO(out, rc = -EINVAL);
}
- if (!fid_is_norm(f) && !fid_is_igif(f) && !fid_is_root(f)) {
+ if (!fid_is_norm(f) && !fid_is_igif(f) && !fid_is_root(f) &&
+ !fid_seq_is_dot(f->f_seq)) {
CWARN("%s: "DFID" is invalid, sequence should be "
">= "LPX64" or within ["LPX64","LPX64"].\n",
mdd2obd_dev(mdd)->obd_name, PFID(f),
CWARN("%s: "DFID" is invalid, sequence should be "
">= "LPX64" or within ["LPX64","LPX64"].\n",
mdd2obd_dev(mdd)->obd_name, PFID(f),
}
run_test 232 "failed lock should not block umount"
}
run_test 232 "failed lock should not block umount"
[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.64) ] ||
{ skip "Need MDS version at least 2.3.64"; return; }
[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.64) ] ||
{ skip "Need MDS version at least 2.3.64"; return; }
stat $MOUNT/.lustre/fid/$fid > /dev/null ||
error "cannot access $MOUNT using its FID '$fid'"
}
stat $MOUNT/.lustre/fid/$fid > /dev/null ||
error "cannot access $MOUNT using its FID '$fid'"
}
-run_test 233 "checking that OBF of the FS root succeeds"
+run_test 233a "checking that OBF of the FS root succeeds"
+
+test_233b() {
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.5.90) ] ||
+ { skip "Need MDS version at least 2.5.90"; return; }
+
+ local fid=$($LFS path2fid $MOUNT/.lustre)
+ stat $MOUNT/.lustre/fid/$fid > /dev/null ||
+ error "cannot access $MOUNT/.lustre using its FID '$fid'"
+
+ fid=$($LFS path2fid $MOUNT/.lustre/fid)
+ stat $MOUNT/.lustre/fid/$fid > /dev/null ||
+ error "cannot access $MOUNT/.lustre/fid using its FID '$fid'"
+}
+run_test 233b "checking that OBF of the FS .lustre succeeds"
test_234() {
local p="$TMP/sanityN-$TESTNAME.parameters"
test_234() {
local p="$TMP/sanityN-$TESTNAME.parameters"