From: bobijam Date: Thu, 13 Sep 2007 03:11:44 +0000 (+0000) Subject: Branch b1_6 X-Git-Tag: v1_8_0_110~1221 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f1c226bc5f8cf21846540fd4c2f872f5c6401cff;p=fs%2Flustre-release.git Branch b1_6 b=13600 i=kalpak, bobijam original patch by adilger. Description: "lfs find -obd UUID" prints directories Details : "lfs find -obd UUID" will return all directory names instead of just file names. It is incorrect because the directories do not reside on the OSTs. --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 4c093e5..b387525 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -37,6 +37,13 @@ Bugzilla : 2369 Description: use i_size_read and i_size_write in 2.6 port Details : replace inode->i_size access with i_size_read/write() +Severity : normal +Bugzilla : 13600 +Description: "lfs find -obd UUID" prints directories +Details : "lfs find -obd UUID" will return all directory names instead + of just file names. It is incorrect because the directories + do not reside on the OSTs. + -------------------------------------------------------------------------------- 2007-09-27 Cluster File Systems, Inc. diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 2d3add3..f04644a 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2368,6 +2368,15 @@ test_56h() { } run_test 56h "check lfs find ! -name =============================" +test_56i() { + tdir=${tdir}i + mkdir -p $DIR/$tdir + UUID=`$GETSTRIPE $DIR/$tdir | awk '/0: / { print $2 }'` + OUT="`$LFIND -ost $UUID $DIR/$tdir`" + [ "$OUT" ] && error "$LFIND returned directory '$OUT'" || true +} +run_test 56i "check 'lfs find -ost UUID' skips directories =======" + test_57a() { remote_mds && skip "remote MDS" && return diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index af2ed37..cb70a99 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -133,7 +133,6 @@ int llapi_file_open(const char *name, int flags, int mode, if (errno != EEXIST && errno != EALREADY) errmsg = strerror(errno); - rc = -errno; fprintf(stderr, "error on ioctl "LPX64" for '%s' (%d): %s\n", (__u64)LL_IOC_LOV_SETSTRIPE, name, fd, errmsg); } @@ -784,10 +783,12 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, void *data) decision = -1; /* If a OST UUID is given, and some OST matches, check it here. */ - if (decision != -1 && param->obdindex != OBD_NOT_FOUND && - S_ISREG(st->st_mode)) { - /* Only those files should be accepted, which have a strip on - * the specified OST. */ + if (decision != -1 && param->obdindex != OBD_NOT_FOUND) { + if (!S_ISREG(st->st_mode)) + goto decided; + + /* Only those files should be accepted, which have a + * stripe on the specified OST. */ if (!param->lmd->lmd_lmm.lmm_stripe_count) { decision = -1; } else { @@ -846,6 +847,7 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, void *data) printf("\n"); } +decided: /* Do not get down anymore? */ if (param->depth == param->maxdepth) return 1;