From 2ef04b0b0ddb5a5944e6e8cf5572c64a0efd2323 Mon Sep 17 00:00:00 2001 From: yury Date: Tue, 16 Nov 2004 14:04:12 +0000 Subject: [PATCH] - one more fid management correctness test. --- lustre/mds/lproc_mds.c | 1 - lustre/tests/sanity-fid.sh | 30 +++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lustre/mds/lproc_mds.c b/lustre/mds/lproc_mds.c index 80fd37b..37d6d67 100644 --- a/lustre/mds/lproc_mds.c +++ b/lustre/mds/lproc_mds.c @@ -116,7 +116,6 @@ static int lprocfs_rd_group(char *page, char **start, off_t off, { struct obd_device *obd = (struct obd_device *)data; struct mds_obd *mds = &obd->u.mds; - __u64 last_fid; *eof = 1; return snprintf(page, count, LPD64"\n", mds->mds_num); diff --git a/lustre/tests/sanity-fid.sh b/lustre/tests/sanity-fid.sh index ebce17f..5d61718 100644 --- a/lustre/tests/sanity-fid.sh +++ b/lustre/tests/sanity-fid.sh @@ -203,7 +203,7 @@ test_1a() { diff=$(($new_last_fid-$old_last_fid)) [ $diff -ne 5000 ] && { - echo "invalid fid management: \ + echo "invalid fid management on $MDS: \ old $old_last_fid, new $new_last_fid" error } @@ -211,6 +211,34 @@ test_1a() { } run_test 1a " fid managing correctness =============" +test_1b() { + rm -fr $DIR/1b0 > /dev/null + MDS=`find /proc/fs/lustre/mds/* -type d | head -n1 | sed 's/.*\///'` + [ -z "$MDS" ] && { + echo "no MDS available, skipping test" + return 0 + } + count=`find /proc/fs/lustre/mds/* -type d | wc -l` + [ $count -gt 1 ] && { + echo "more than 1 MDS is found, skipping test" + return 0 + } + + mkdir $DIR/1b0 || error + createmany -o $DIR/1b0/f 5000 + old_last_fid=`cat /proc/fs/lustre/mds/$MDS/last_fid` + rm -fr $DIR/1b0/f + new_last_fid=`cat /proc/fs/lustre/mds/$MDS/last_fid` + + [ $new_last_fid -ne $old_last_fid ] && { + echo "invalid fid management on $MDS: \ + old $old_last_fid, new $new_last_fid" + error + } + rm -fr $DIR/1b0 || error +} +run_test 1b " fid managing correctness =============" + TMPDIR=$OLDTMPDIR TMP=$OLDTMP HOME=$OLDHOME -- 1.8.3.1