diff options
author | Bhumika Goyal <bgoyal@redhat.com> | 2018-08-20 15:40:06 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-20 15:49:26 +0000 |
commit | a3a3b8ec67fa1609e06b1d919675e3df74d531e5 (patch) | |
tree | f0ac0ead054e3e3a685937863d2109c55ff01e7c /xlators/performance | |
parent | bb7d3fbfe14c81c5bd4c0132ce4e300b887f8e76 (diff) |
write-behind: coverity fixes
Fixes CID: 1124360 1291740 1370918
Change-Id: I008c7ade8f9809d040f42f6d3e9af70fff2f3dc6
updates: bz#789278
Signed-off-by: Bhumika Goyal <bgoyal@redhat.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r-- | xlators/performance/write-behind/src/write-behind.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 275c3e97fee..095d756b663 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -197,8 +197,12 @@ __wb_inode_ctx_get (xlator_t *this, inode_t *inode) { uint64_t value = 0; wb_inode_t *wb_inode = NULL; + int ret = 0; + + ret = __inode_ctx_get (inode, this, &value); + if (ret) + return NULL; - __inode_ctx_get (inode, this, &value); wb_inode = (wb_inode_t *)(unsigned long) value; return wb_inode; @@ -521,7 +525,7 @@ wb_enqueue_common (wb_inode_t *wb_inode, call_stub_t *stub, int tempted) req->op_ret = req->write_size; req->op_errno = 0; - if (stub->args.fd->flags & O_APPEND) + if (stub->args.fd && (stub->args.fd->flags & O_APPEND)) req->ordering.append = 1; } @@ -2786,7 +2790,7 @@ wb_release (xlator_t *this, fd_t *fd) { uint64_t tmp = 0; - fd_ctx_del (fd, this, &tmp); + (void) fd_ctx_del (fd, this, &tmp); return 0; } |