summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2018-08-20 14:10:52 -0700
committergluster-ant <bugzilla-bot@gluster.org>2018-08-20 14:10:52 -0700
commit0cdcdfe208ae698c2904c4af5e957005c25dc7db (patch)
tree61cc4274b38bbf7bbf4bb32e527ac2f919a49a39
parent8edd5b17998ea2416c74f9ea20645f3ed8e5ea33 (diff)
downloadglusterfs-0cdcdfe208ae698c2904c4af5e957005c25dc7db.tar.gz
glusterfs-0cdcdfe208ae698c2904c4af5e957005c25dc7db.tar.xz
glusterfs-0cdcdfe208ae698c2904c4af5e957005c25dc7db.zip
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>
-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 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;