chmod of .lustre/fid is unsupported on servers older than v2.4.
Add a version check to skip the unsupported op in sanity test 154a
on old servers for interop testing of 2.4+ clients on 2.3 servers.
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I353c93e8d1501944cad8f638de69a0432539249f
Reviewed-on: http://review.whamcloud.com/6879
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
mrename $test_dir/$tdir $MOUNT/.lustre/fid &&
error "rename to $MOUNT/.lustre/fid should fail."
mrename $test_dir/$tdir $MOUNT/.lustre/fid &&
error "rename to $MOUNT/.lustre/fid should fail."
- local old_obf_mode=$(stat --format="%a" $DIR/.lustre/fid)
- local new_obf_mode=777
-
- echo "change mode of $DIR/.lustre/fid to $new_obf_mode"
- chmod $new_obf_mode $DIR/.lustre/fid ||
- error "chmod $new_obf_mode $DIR/.lustre/fid failed"
-
- local obf_mode=$(stat --format=%a $DIR/.lustre/fid)
- [ $obf_mode -eq $new_obf_mode ] ||
- error "stat $DIR/.lustre/fid returned wrong mode $obf_mode"
-
- echo "restore mode of $DIR/.lustre/fid to $old_obf_mode"
- chmod $old_obf_mode $DIR/.lustre/fid ||
- error "chmod $old_obf_mode $DIR/.lustre/fid failed"
+ if [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.51) ]
+ then # LU-3547
+ local old_obf_mode=$(stat --format="%a" $DIR/.lustre/fid)
+ local new_obf_mode=777
+
+ echo "change mode of $DIR/.lustre/fid to $new_obf_mode"
+ chmod $new_obf_mode $DIR/.lustre/fid ||
+ error "chmod $new_obf_mode $DIR/.lustre/fid failed"
+
+ local obf_mode=$(stat --format=%a $DIR/.lustre/fid)
+ [ $obf_mode -eq $new_obf_mode ] ||
+ error "stat $DIR/.lustre/fid returned wrong mode $obf_mode"
+
+ echo "restore mode of $DIR/.lustre/fid to $old_obf_mode"
+ chmod $old_obf_mode $DIR/.lustre/fid ||
+ error "chmod $old_obf_mode $DIR/.lustre/fid failed"
+ fi
$OPENFILE -f O_LOV_DELAY_CREATE:O_CREAT $test_dir/$tfile-2
fid=$($LFS path2fid $test_dir/$tfile-2)
$OPENFILE -f O_LOV_DELAY_CREATE:O_CREAT $test_dir/$tfile-2
fid=$($LFS path2fid $test_dir/$tfile-2)