summaryrefslogtreecommitdiff
path: root/fs/orangefs/dir.c
diff options
context:
space:
mode:
authorMike Marshall <hubcap@omnibond.com>2015-07-29 20:36:37 +0300
committerMike Marshall <hubcap@omnibond.com>2015-10-03 18:40:03 +0300
commiteeaa3d448c5d35ad0dc16a981aacd64139c53eee (patch)
tree113bc05b053812e48a281bfb015b25958fa697e6 /fs/orangefs/dir.c
parent84d02150dea7571dc32176e35d65eecde82631a9 (diff)
downloadlinux-eeaa3d448c5d35ad0dc16a981aacd64139c53eee.tar.xz
Orangefs: address problems found by static checker
Don't check for negative rc from boolean. Don't pointlessly initialize variables, it short-circuits gcc's uninitialized variable warnings. And max_new_nr_segs can never be zero, so don't check for it. Preserve original kstrdup pointer for freeing later. Don't check for negative value in unsigned variable. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/dir.c')
-rw-r--r--fs/orangefs/dir.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c
index 9b5f4bb17874..c126c0fc6e0f 100644
--- a/fs/orangefs/dir.c
+++ b/fs/orangefs/dir.c
@@ -104,7 +104,6 @@ static void readdir_handle_dtor(struct pvfs2_bufmap *bufmap,
*
* \param dir_emit callback function called for each entry read.
*
- * \retval <0 on error
* \retval 0 when directory has been completely traversed
* \retval >0 if we don't call dir_emit for all entries
*
@@ -253,8 +252,6 @@ get_new_buffer_index:
__func__,
llu(pos));
ret = dir_emit(ctx, ".", 1, ino, DT_DIR);
- if (ret < 0)
- goto out_destroy_handle;
ctx->pos++;
gossip_ldebug(GOSSIP_DIR_DEBUG,
"%s: ctx->pos:%lld\n",
@@ -270,8 +267,6 @@ get_new_buffer_index:
__func__,
llu(pos));
ret = dir_emit(ctx, "..", 2, ino, DT_DIR);
- if (ret < 0)
- goto out_destroy_handle;
ctx->pos++;
gossip_ldebug(GOSSIP_DIR_DEBUG,
"%s: ctx->pos:%lld\n",
@@ -293,17 +288,6 @@ get_new_buffer_index:
(unsigned long)pos);
ret =
dir_emit(ctx, current_entry, len, current_ino, DT_UNKNOWN);
- if (ret < 0) {
- gossip_debug(GOSSIP_DIR_DEBUG,
- "dir_emit() failed. ret:%d\n",
- ret);
- if (i < 2) {
- gossip_err("dir_emit failed on one of the first two true PVFS directory entries.\n");
- gossip_err("Duplicate entries may appear.\n");
- }
- buffer_full = 1;
- break;
- }
ctx->pos++;
gossip_ldebug(GOSSIP_DIR_DEBUG,
"%s: ctx->pos:%lld\n",