From 176724cdec7061ead0bd7497bb56d0ac09a668a7 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Tue, 10 May 2016 13:03:42 +0530 Subject: 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. Change-Id: I674f747c73369d0597a9c463e6ea4c85b9091355 BUG: 1334621 Signed-off-by: Soumya Koduri Reviewed-on: http://review.gluster.org/14278 Smoke: Gluster Build System Reviewed-by: Niels de Vos NetBSD-regression: NetBSD Build System Reviewed-by: jiffin tony Thottan Reviewed-by: Kaleb KEITHLEY CentOS-regression: Gluster Build System --- api/src/glfs-handleops.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'api/src/glfs-handleops.c') diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index 72aa7de146e..721187f8342 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; } -- cgit