From e9e4084a98c5b94664b357c279f13660db805107 Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Wed, 16 Jun 2010 00:08:27 +0400 Subject: [PATCH] b=21665 "lfs osts" incorrectly tries to traverse lustre mount We don't want to traverse the directory tree, so return a positive value from sem_init to terminate the traversal before it starts. a=Joseph Herring (LLNL) i=Andreas Dilger i=Andrew Perepechko --- 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 7224c5a..6ac3882 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -1361,11 +1361,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