summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-11 18:24:21 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-18 19:13:08 +0530
commitfe06790a3637c30dc8d5e0be7367f27ee24c36bd (patch)
tree0a3d6bc9dfa3e27e32e0890358059d6c0cc097f1
parent1279d7398c63bdad448cf0418579f6df1d9f6f34 (diff)
libglusterfsclient: Wipe loc->ino in libgf_client_loc_wipe
Not cleaning up the ino member of a loc_t results in SIGABRT in __inode_link because in some cases, the loc->ino is different from loc->inode->ino. This happens especially in code blocks which re-use a loc_t structure for pointing at different inodes/files. For eg, if a loc_t has been assigned an inode and an ino, and followed by a libgf_client_loc_wipe, then re-use of this loc in say libgf_client_lookup results the SIGABRT because libgf_client_lookup calls inode_link with the same loc_t. However, this loc_t has just been assigned a new inode pointer but the ino member still contains a previous inode's inode number. This difference in inode numbers results in an assertion failure, so the SIGABRT. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 095edaa7cf7..91f1057765c 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -532,6 +532,7 @@ libgf_client_loc_wipe (loc_t *loc)
}
loc->path = loc->name = NULL;
+ loc->ino = 0;
}