From 0cdcdfe208ae698c2904c4af5e957005c25dc7db Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Mon, 20 Aug 2018 14:10:52 -0700 Subject: features/sdfs: Minor improvements Addresses: CID 1389688: Prevent op_errno from being -ve in sdfs_rename() CID 1389286: Check for retval from loc_copy() to avoid logically dead code and Initializes op_errno to ENOMEM in sdfs_link() Change-Id: I12e17a98faa5887da94a33ba9ca775e8e0fef359 updates: bz#789278 Signed-off-by: Vijay Bellur --- xlators/features/sdfs/src/sdfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xlators/features/sdfs/src/sdfs.c b/xlators/features/sdfs/src/sdfs.c index 5ddbe78250..57c1cbb581 100644 --- a/xlators/features/sdfs/src/sdfs.c +++ b/xlators/features/sdfs/src/sdfs.c @@ -895,7 +895,7 @@ sdfs_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, sdfs_lock_t *lock = NULL; client_t *client = NULL; int ret = 0; - int op_errno = 0; + int op_errno = ENOMEM; new_frame = copy_frame (frame); if (!new_frame) { @@ -928,7 +928,7 @@ sdfs_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, local->lock = lock; GF_ATOMIC_INIT (local->call_cnt, lock->lock_count); - loc_copy (&local->loc, newloc); + ret = loc_copy (&local->loc, newloc); if (ret == -1) { op_errno = ENOMEM; goto err; @@ -1159,7 +1159,7 @@ sdfs_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc, call_stub_t *stub = NULL; client_t *client = NULL; int ret = 0; - int op_errno = -1; + int op_errno = ENOMEM; int i = 0; int call_cnt = 0; -- cgit