b51a1f
From 46e2bbd52d4427c1348fa38dcb5d2b5f125555f1 Mon Sep 17 00:00:00 2001
b51a1f
From: Amar Tumballi <amarts@redhat.com>
b51a1f
Date: Thu, 30 May 2019 15:25:01 +0530
b51a1f
Subject: [PATCH 522/526] lcov: improve line coverage
b51a1f
b51a1f
upcall: remove extra variable assignment and use just one
b51a1f
        initialization.
b51a1f
open-behind: reduce the overall number of lines, in functions
b51a1f
             not frequently called
b51a1f
selinux: reduce some lines in init failure cases
b51a1f
b51a1f
Upstream patch:
b51a1f
> Upstream-patch-link: https://review.gluster.org/#/c/glusterfs/+/22789
b51a1f
> updates: bz#1693692
b51a1f
> Change-Id: I7c1de94f2ec76a5bfe1f48a9632879b18e5fbb95
b51a1f
> Signed-off-by: Amar Tumballi <amarts@redhat.com>
b51a1f
b51a1f
BUG: 1830713
b51a1f
Change-Id: I7c1de94f2ec76a5bfe1f48a9632879b18e5fbb95
b51a1f
Signed-off-by: Amar Tumballi <amarts@redhat.com>
b51a1f
Reviewed-on: https://code.engineering.redhat.com/gerrit/224486
b51a1f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
b51a1f
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
b51a1f
---
b51a1f
 xlators/features/selinux/src/selinux.c            |   6 +-
b51a1f
 xlators/features/upcall/src/upcall.c              | 108 +++++++---------------
b51a1f
 xlators/performance/open-behind/src/open-behind.c |  58 ++++--------
b51a1f
 3 files changed, 55 insertions(+), 117 deletions(-)
b51a1f
b51a1f
diff --git a/xlators/features/selinux/src/selinux.c b/xlators/features/selinux/src/selinux.c
b51a1f
index 58b4c5d..e8e16cd 100644
b51a1f
--- a/xlators/features/selinux/src/selinux.c
b51a1f
+++ b/xlators/features/selinux/src/selinux.c
b51a1f
@@ -234,7 +234,6 @@ init(xlator_t *this)
b51a1f
     priv = GF_CALLOC(1, sizeof(*priv), gf_selinux_mt_selinux_priv_t);
b51a1f
     if (!priv) {
b51a1f
         gf_log(this->name, GF_LOG_ERROR, "out of memory");
b51a1f
-        ret = ENOMEM;
b51a1f
         goto out;
b51a1f
     }
b51a1f
 
b51a1f
@@ -242,7 +241,6 @@ init(xlator_t *this)
b51a1f
 
b51a1f
     this->local_pool = mem_pool_new(selinux_priv_t, 64);
b51a1f
     if (!this->local_pool) {
b51a1f
-        ret = -1;
b51a1f
         gf_msg(this->name, GF_LOG_ERROR, ENOMEM, SL_MSG_ENOMEM,
b51a1f
                "Failed to create local_t's memory pool");
b51a1f
         goto out;
b51a1f
@@ -252,9 +250,7 @@ init(xlator_t *this)
b51a1f
     ret = 0;
b51a1f
 out:
b51a1f
     if (ret) {
b51a1f
-        if (priv) {
b51a1f
-            GF_FREE(priv);
b51a1f
-        }
b51a1f
+        GF_FREE(priv);
b51a1f
         mem_pool_destroy(this->local_pool);
b51a1f
     }
b51a1f
     return ret;
b51a1f
diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c
b51a1f
index 2583c50..0795f58 100644
b51a1f
--- a/xlators/features/upcall/src/upcall.c
b51a1f
+++ b/xlators/features/upcall/src/upcall.c
b51a1f
@@ -57,14 +57,13 @@ static int32_t
b51a1f
 up_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
b51a1f
         fd_t *fd, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -111,14 +110,13 @@ up_writev(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
b51a1f
           int count, off_t off, uint32_t flags, struct iobref *iobref,
b51a1f
           dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -167,14 +165,13 @@ static int32_t
b51a1f
 up_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
b51a1f
          off_t offset, uint32_t flags, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -220,14 +217,13 @@ static int32_t
b51a1f
 up_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
b51a1f
       struct gf_flock *flock, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -274,14 +270,13 @@ static int32_t
b51a1f
 up_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
b51a1f
             dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -343,14 +338,13 @@ static int32_t
b51a1f
 up_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf,
b51a1f
            int32_t valid, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -410,14 +404,13 @@ static int32_t
b51a1f
 up_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
b51a1f
           dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, newloc, NULL, oldloc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -472,14 +465,13 @@ static int32_t
b51a1f
 up_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
b51a1f
           dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, loc, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -531,14 +523,13 @@ static int32_t
b51a1f
 up_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
b51a1f
         dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, newloc, NULL, oldloc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -592,14 +583,13 @@ static int32_t
b51a1f
 up_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
b51a1f
          dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, loc, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -653,14 +643,13 @@ static int32_t
b51a1f
 up_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
b51a1f
          mode_t umask, dict_t *params)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, loc, NULL, loc->parent, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -717,15 +706,13 @@ static int32_t
b51a1f
 up_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
b51a1f
           mode_t mode, mode_t umask, fd_t *fd, dict_t *params)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, loc, NULL, loc->parent, NULL);
b51a1f
-
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -774,14 +761,13 @@ out:
b51a1f
 static int32_t
b51a1f
 up_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -826,14 +812,13 @@ out:
b51a1f
 static int32_t
b51a1f
 up_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -852,14 +837,13 @@ err:
b51a1f
 static int32_t
b51a1f
 up_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -879,14 +863,13 @@ static int32_t
b51a1f
 up_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
b51a1f
              dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -932,14 +915,13 @@ static int32_t
b51a1f
 up_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
b51a1f
           dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -986,14 +968,13 @@ static int32_t
b51a1f
 up_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
b51a1f
             dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1047,14 +1028,13 @@ static int32_t
b51a1f
 up_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
b51a1f
          dev_t rdev, mode_t umask, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, loc, NULL, loc->parent, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1110,14 +1090,13 @@ static int32_t
b51a1f
 up_symlink(call_frame_t *frame, xlator_t *this, const char *linkpath,
b51a1f
            loc_t *loc, mode_t umask, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, loc, NULL, loc->parent, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1164,14 +1143,13 @@ static int32_t
b51a1f
 up_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
b51a1f
            dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1216,14 +1194,13 @@ out:
b51a1f
 static int32_t
b51a1f
 up_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1270,14 +1247,13 @@ static int32_t
b51a1f
 up_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
b51a1f
            off_t off, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1334,14 +1310,13 @@ static int32_t
b51a1f
 up_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
b51a1f
             off_t off, dict_t *dict)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1361,14 +1336,13 @@ static int32_t
b51a1f
 up_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
b51a1f
             int32_t valid, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1415,14 +1389,13 @@ static int32_t
b51a1f
 up_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
b51a1f
              off_t offset, size_t len, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1470,14 +1443,13 @@ static int32_t
b51a1f
 up_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
b51a1f
            size_t len, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1524,14 +1496,13 @@ static int
b51a1f
 up_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
b51a1f
             off_t len, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1577,14 +1548,13 @@ static int32_t
b51a1f
 up_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
b51a1f
         gf_seek_what_t what, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1652,14 +1622,13 @@ static int32_t
b51a1f
 up_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
b51a1f
             int32_t flags, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, loc, NULL, loc->inode, dict);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1727,14 +1696,13 @@ static int32_t
b51a1f
 up_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
b51a1f
              int32_t flags, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, fd, fd->inode, dict);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1800,7 +1768,7 @@ static int32_t
b51a1f
 up_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
b51a1f
                 dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
     dict_t *xattr = NULL;
b51a1f
 
b51a1f
@@ -1808,13 +1776,11 @@ up_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
b51a1f
 
b51a1f
     xattr = dict_for_key_value(name, "", 1, _gf_true);
b51a1f
     if (!xattr) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, fd, fd->inode, xattr);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1885,7 +1851,7 @@ static int32_t
b51a1f
 up_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
b51a1f
                const char *name, dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
     dict_t *xattr = NULL;
b51a1f
 
b51a1f
@@ -1893,13 +1859,11 @@ up_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
b51a1f
 
b51a1f
     xattr = dict_for_key_value(name, "", 1, _gf_true);
b51a1f
     if (!xattr) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, loc, NULL, loc->inode, xattr);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -1950,14 +1914,13 @@ static int32_t
b51a1f
 up_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
b51a1f
              dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, fd->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -2000,14 +1963,13 @@ static int32_t
b51a1f
 up_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name,
b51a1f
             dict_t *xdata)
b51a1f
 {
b51a1f
-    int32_t op_errno = -1;
b51a1f
+    int32_t op_errno = ENOMEM;
b51a1f
     upcall_local_t *local = NULL;
b51a1f
 
b51a1f
     EXIT_IF_UPCALL_OFF(this, out);
b51a1f
 
b51a1f
     local = upcall_local_init(frame, this, NULL, NULL, loc->inode, NULL);
b51a1f
     if (!local) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
diff --git a/xlators/performance/open-behind/src/open-behind.c b/xlators/performance/open-behind/src/open-behind.c
b51a1f
index dd2f2fd..cbe89ec 100644
b51a1f
--- a/xlators/performance/open-behind/src/open-behind.c
b51a1f
+++ b/xlators/performance/open-behind/src/open-behind.c
b51a1f
@@ -581,7 +581,7 @@ ob_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd,
b51a1f
 {
b51a1f
     fd_t *old_fd = NULL;
b51a1f
     int ret = -1;
b51a1f
-    int op_errno = 0;
b51a1f
+    int op_errno = ENOMEM;
b51a1f
     call_stub_t *stub = NULL;
b51a1f
 
b51a1f
     old_fd = fd_lookup(fd->inode, 0);
b51a1f
@@ -589,7 +589,6 @@ ob_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd,
b51a1f
         /* open-behind only when this is the first FD */
b51a1f
         stub = fop_open_stub(frame, default_open_resume, loc, flags, fd, xdata);
b51a1f
         if (!stub) {
b51a1f
-            op_errno = ENOMEM;
b51a1f
             fd_unref(old_fd);
b51a1f
             goto err;
b51a1f
         }
b51a1f
@@ -603,7 +602,6 @@ ob_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, fd_t *fd,
b51a1f
 
b51a1f
     ret = ob_open_behind(frame, this, loc, flags, fd, xdata);
b51a1f
     if (ret) {
b51a1f
-        op_errno = ENOMEM;
b51a1f
         goto err;
b51a1f
     }
b51a1f
 
b51a1f
@@ -900,18 +898,12 @@ int
b51a1f
 ob_finodelk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd,
b51a1f
             int cmd, struct gf_flock *flock, dict_t *xdata)
b51a1f
 {
b51a1f
-    call_stub_t *stub = NULL;
b51a1f
-
b51a1f
-    stub = fop_finodelk_stub(frame, default_finodelk_resume, volume, fd, cmd,
b51a1f
-                             flock, xdata);
b51a1f
-    if (!stub)
b51a1f
-        goto err;
b51a1f
-
b51a1f
-    open_and_resume(this, fd, stub);
b51a1f
-
b51a1f
-    return 0;
b51a1f
-err:
b51a1f
-    STACK_UNWIND_STRICT(finodelk, frame, -1, ENOMEM, 0);
b51a1f
+    call_stub_t *stub = fop_finodelk_stub(frame, default_finodelk_resume,
b51a1f
+                                          volume, fd, cmd, flock, xdata);
b51a1f
+    if (stub)
b51a1f
+        open_and_resume(this, fd, stub);
b51a1f
+    else
b51a1f
+        STACK_UNWIND_STRICT(finodelk, frame, -1, ENOMEM, 0);
b51a1f
 
b51a1f
     return 0;
b51a1f
 }
b51a1f
@@ -921,18 +913,12 @@ ob_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd,
b51a1f
             const char *basename, entrylk_cmd cmd, entrylk_type type,
b51a1f
             dict_t *xdata)
b51a1f
 {
b51a1f
-    call_stub_t *stub = NULL;
b51a1f
-
b51a1f
-    stub = fop_fentrylk_stub(frame, default_fentrylk_resume, volume, fd,
b51a1f
-                             basename, cmd, type, xdata);
b51a1f
-    if (!stub)
b51a1f
-        goto err;
b51a1f
-
b51a1f
-    open_and_resume(this, fd, stub);
b51a1f
-
b51a1f
-    return 0;
b51a1f
-err:
b51a1f
-    STACK_UNWIND_STRICT(fentrylk, frame, -1, ENOMEM, 0);
b51a1f
+    call_stub_t *stub = fop_fentrylk_stub(
b51a1f
+        frame, default_fentrylk_resume, volume, fd, basename, cmd, type, xdata);
b51a1f
+    if (stub)
b51a1f
+        open_and_resume(this, fd, stub);
b51a1f
+    else
b51a1f
+        STACK_UNWIND_STRICT(fentrylk, frame, -1, ENOMEM, 0);
b51a1f
 
b51a1f
     return 0;
b51a1f
 }
b51a1f
@@ -941,18 +927,12 @@ int
b51a1f
 ob_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd,
b51a1f
             gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata)
b51a1f
 {
b51a1f
-    call_stub_t *stub = NULL;
b51a1f
-
b51a1f
-    stub = fop_fxattrop_stub(frame, default_fxattrop_resume, fd, optype, xattr,
b51a1f
-                             xdata);
b51a1f
-    if (!stub)
b51a1f
-        goto err;
b51a1f
-
b51a1f
-    open_and_resume(this, fd, stub);
b51a1f
-
b51a1f
-    return 0;
b51a1f
-err:
b51a1f
-    STACK_UNWIND_STRICT(fxattrop, frame, -1, ENOMEM, 0, 0);
b51a1f
+    call_stub_t *stub = fop_fxattrop_stub(frame, default_fxattrop_resume, fd,
b51a1f
+                                          optype, xattr, xdata);
b51a1f
+    if (stub)
b51a1f
+        open_and_resume(this, fd, stub);
b51a1f
+    else
b51a1f
+        STACK_UNWIND_STRICT(fxattrop, frame, -1, ENOMEM, 0, 0);
b51a1f
 
b51a1f
     return 0;
b51a1f
 }
b51a1f
-- 
b51a1f
1.8.3.1
b51a1f