summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-handleops.c
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2016-05-10 13:03:42 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-05-11 07:36:18 -0700
commit9a7f210e0954ea8a6bcc224f515094bdf4b7762c (patch)
tree179347db31c25e0819655692b6d264b62f14c1b8 /api/src/glfs-handleops.c
parentb798f82c2e8d786797e34865d464b92fb4e9b641 (diff)
libglusterfs/gfapi: set appropriate errno for inode_link failures
We do not seem to be setting errno appropriately in case of inode_link failures. This errno may be used by any application (for eg., nfs-ganesha) to determine the error encountered. This patch addresses the same. This is backport of below mainline fix - http://review.gluster.org/14278 Change-Id: I674f747c73369d0597a9c463e6ea4c85b9091355 BUG: 1335017 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/14278 Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/14288 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'api/src/glfs-handleops.c')
-rw-r--r--api/src/glfs-handleops.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index a230578b615..fdde2e57568 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1332,11 +1332,9 @@ pub_glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
}
inode_lookup (newinode);
} else {
- gf_msg (subvol->name, GF_LOG_WARNING, EINVAL,
- API_MSG_INVALID_ENTRY,
- "inode linking of %s failed: %s",
- uuid_utoa (loc.gfid), strerror (errno));
- errno = EINVAL;
+ gf_msg (subvol->name, GF_LOG_WARNING, errno,
+ API_MSG_INODE_LINK_FAILED,
+ "inode linking of %s failed", uuid_utoa (loc.gfid));
goto out;
}