diff options
author | Soumya Koduri <skoduri@redhat.com> | 2016-05-10 13:03:42 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2016-05-10 09:10:25 -0700 |
commit | 176724cdec7061ead0bd7497bb56d0ac09a668a7 (patch) | |
tree | 1460d38b26070137b2cfcb289434aaa21769de0e /api/src/glfs-resolve.c | |
parent | f3699f32fd8d468f757697fdacf4949b8d5312d5 (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.
Change-Id: I674f747c73369d0597a9c463e6ea4c85b9091355
BUG: 1334621
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/14278
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'api/src/glfs-resolve.c')
-rw-r--r-- | api/src/glfs-resolve.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c index 9d8ea2c4553..7a7064c3aa2 100644 --- a/api/src/glfs-resolve.c +++ b/api/src/glfs-resolve.c @@ -129,6 +129,11 @@ glfs_refresh_inode_safe (xlator_t *subvol, inode_t *oldinode, if (newinode == loc.inode) inode_ctx_set (newinode, THIS, &ctx_value); inode_lookup (newinode); + } else { + gf_msg (subvol->name, GF_LOG_WARNING, errno, + API_MSG_INODE_LINK_FAILED, + "inode linking of %s failed", + uuid_utoa ((unsigned char *)&iatt.ia_gfid)); } loc_wipe (&loc); @@ -341,7 +346,14 @@ glfs_resolve_component (struct glfs *fs, xlator_t *subvol, inode_t *parent, goto out; inode = inode_link (loc.inode, loc.parent, component, &ciatt); - if (inode == loc.inode) + + if (!inode) { + gf_msg (subvol->name, GF_LOG_WARNING, errno, + API_MSG_INODE_LINK_FAILED, + "inode linking of %s failed", + uuid_utoa ((unsigned char *)&ciatt.ia_gfid)); + goto out; + } else if (inode == loc.inode) inode_ctx_set (inode, THIS, &ctx_value); found: if (inode) |