summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2018-08-20 14:10:52 -0700
committerShyamsundar Ranganathan <srangana@redhat.com>2018-08-21 13:34:12 +0000
commit2ea2d68776e21f4bfa8d13fc79b7a7ef0818ad0b (patch)
tree61cc4274b38bbf7bbf4bb32e527ac2f919a49a39 /xlators/features
parent0eac8026f880bf8bf7e05530de16a06ba3e8a40c (diff)
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 <vbellur@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/sdfs/src/sdfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/features/sdfs/src/sdfs.c b/xlators/features/sdfs/src/sdfs.c
index 5ddbe78250f..57c1cbb581b 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;