From: Andrew Perepechko Date: Tue, 15 Jun 2010 20:08:27 +0000 (+0400) Subject: b=21665 "lfs osts" incorrectly tries to traverse lustre mount X-Git-Tag: v2_0_0-rc1~43 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e9e4084a98c5b94664b357c279f13660db805107;p=fs%2Flustre-release.git 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 --- 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)