Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-5095 hsm: Allow receiving messages to be non-blocking
[fs/lustre-release.git]
/
lustre
/
utils
/
llverfs.c
diff --git
a/lustre/utils/llverfs.c
b/lustre/utils/llverfs.c
index
953f342
..
87c9a9c
100644
(file)
--- a/
lustre/utils/llverfs.c
+++ b/
lustre/utils/llverfs.c
@@
-27,7
+27,7
@@
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011,
Whamcloud, Inc
.
+ * Copyright (c) 2011,
Intel Corporation
.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-527,6
+527,7
@@
static int dir_write(char *chunk_buf, size_t chunksize,
struct timeval start_time;
unsigned long long total_bytes;
unsigned long long curr_bytes = 0;
struct timeval start_time;
unsigned long long total_bytes;
unsigned long long curr_bytes = 0;
+ int rc = 0;
#ifdef HAVE_EXT2FS_EXT2FS_H
if (!full && fsetflags(testdir, EXT2_TOPDIR_FL))
#ifdef HAVE_EXT2FS_EXT2FS_H
if (!full && fsetflags(testdir, EXT2_TOPDIR_FL))
@@
-545,7
+546,8
@@
static int dir_write(char *chunk_buf, size_t chunksize,
fflush(countfile) != 0) {
fprintf(stderr, "\n%s: writing %s failed :%s\n",
progname, filecount, strerror(errno));
fflush(countfile) != 0) {
fprintf(stderr, "\n%s: writing %s failed :%s\n",
progname, filecount, strerror(errno));
- return 6;
+ rc = 6;
+ goto out;
}
/* calculate total bytes that need to be written */
}
/* calculate total bytes that need to be written */
@@
-553,7
+555,8
@@
static int dir_write(char *chunk_buf, size_t chunksize,
if (total_bytes <= 0) {
fprintf(stderr, "\n%s: unable to calculate total bytes\n",
progname);
if (total_bytes <= 0) {
fprintf(stderr, "\n%s: unable to calculate total bytes\n",
progname);
- return 7;
+ rc = 7;
+ goto out;
}
if (!full && (dir_num != 0))
}
if (!full && (dir_num != 0))
@@
-575,7
+578,8
@@
static int dir_write(char *chunk_buf, size_t chunksize,
fprintf(stderr, "\n%s: mkdir %s : %s\n",
progname, tempdir,
strerror(errno));
fprintf(stderr, "\n%s: mkdir %s : %s\n",
progname, tempdir,
strerror(errno));
- return 1;
+ rc = 1;
+ goto out;
}
}
dir_num++;
}
}
dir_num++;
@@
-600,8
+604,10
@@
static int dir_write(char *chunk_buf, size_t chunksize,
time_st, inode_st, tempfile);
close(fd);
if (ret < 0) {
time_st, inode_st, tempfile);
close(fd);
if (ret < 0) {
- if (ret != -ENOSPC)
- return 1;
+ if (ret != -ENOSPC) {
+ rc = 1;
+ goto out;
+ }
curr_bytes = total_bytes;
break;
}
curr_bytes = total_bytes;
break;
}
@@
-618,7
+624,6
@@
static int dir_write(char *chunk_buf, size_t chunksize,
progname, filecount, strerror(errno));
}
}
progname, filecount, strerror(errno));
}
}
- fclose(countfile);
if (verbose) {
verbose++;
if (verbose) {
verbose++;
@@
-628,7
+633,10
@@
static int dir_write(char *chunk_buf, size_t chunksize,
verbose--;
}
verbose--;
}
- return 0;
+out:
+ fclose(countfile);
+
+ return rc;
}
/*
}
/*
@@
-861,7
+869,8
@@
guess:
fprintf(stderr, "Memory allocation failed for chunk_buf\n");
return 4;
}
fprintf(stderr, "Memory allocation failed for chunk_buf\n");
return 4;
}
- sprintf(filecount, "%s/%s.filecount", testdir, progname);
+ snprintf(filecount, sizeof(filecount), "%s/%s.filecount",
+ testdir, progname);
if (writeoption) {
(void)mkdir(testdir, dirmode);
if (writeoption) {
(void)mkdir(testdir, dirmode);