From df6f5257fd41702eda8480aa5e8e2ffb865e0a83 Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Wed, 10 Feb 2010 19:34:14 +0300 Subject: [PATCH] b=21665 a small fix for "lfs osts" a=Joseph Herring i=Andreas Dilger i=Andrew Perepechko Actually, we don't want to traverse the directory tree, so return a positive value from sem_init to terminate the traversal before it starts. --- lustre/utils/liblustreapi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 39daf55..d8a35ae 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -1325,11 +1325,18 @@ static int cb_ostlist(char *path, DIR *parent, DIR *d, void *data, struct dirent64 *de) { struct find_param *param = (struct find_param *)data; + int ret; LASSERT(parent != NULL || d != NULL); /* Prepare odb. */ - return setup_obd_uuid(d ? d : parent, path, param); + ret = setup_obd_uuid(d ? d : parent, path, param); + + /* We don't want to actually traverse the directory tree, + * so return a positive value from sem_init to terminate + * the traversal before it starts. + */ + return ret == 0 ? 1 : ret; } int llapi_ostlist(char *path, struct find_param *param) -- 1.8.3.1