summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-07-23 16:19:26 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-27 09:32:31 -0700
commitdf868214c077065cfeafcfdadb6bbf5151d20b3d (patch)
tree00fde82988c8d5275c7e74aff1c4ac6b9029d279 /libglusterfsclient
parent955c6e0c87b501501d87806f1e69ece8f0559dd6 (diff)
libglusterfsclient: Avoid overwrite of inode found through ino number
In libgf_client_loc_fill, there is a possibility that all the ino, par and name are specified as non-NULL,non-zero args. So if an inode is located in the itable using the ino and the subsequent search for the inode using the par-ino and the file name does not result in an inode being found, the current code over-writes the inode that was found through the ino. The correct behaviour is to stop further searches if inode was already found using ino. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 161 (unfs3 crashes on link system call by fileop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=161
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index ec41710f8..a670ffa51 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -841,14 +841,19 @@ libgf_client_loc_fill (loc_t *loc,
if (!inode) {
if (ino)
inode = inode_search (ctx->itable, ino, NULL);
+
+ if (inode)
+ goto inode_found;
+
if (par && name)
inode = inode_search (ctx->itable, par, name);
-
- loc->inode = inode;
}
- if (inode)
+inode_found:
+ if (inode) {
loc->ino = inode->ino;
+ loc->inode = inode;
+ }
parent = loc->parent;
if (!parent) {