summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBasavanagowda Kanur <gowda@gluster.com>2009-02-26 13:38:33 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-02-26 16:56:54 +0530
commitb5377787903109dd5aea408e7b3a8e772b2be4f5 (patch)
tree7146da9313def4b0502f13e4fdf4d41e557d8bdf
parent417dfa48df166bfcd3f8a6da56c189de6e7a6aff (diff)
__inode_unlink() should not be sent a NULL inode.
unlink_inode might be NULL in inode_unlink() under the following circumstances: 1. 'inode' got forget() and was unhashed. 2. 'inode' was replaced by a new inode object and the new object got forget() or was pruned out of the inode table. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--libglusterfs/src/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
index 6c527fc75a3..c64286d405f 100644
--- a/libglusterfs/src/inode.c
+++ b/libglusterfs/src/inode.c
@@ -754,6 +754,8 @@ inode_unlink (inode_t *inode,
{
if (!__is_inode_hashed (inode)) {
unlink_inode = __inode_search (table, inode->ino);
+ if (unlink_inode == NULL)
+ unlink_inode = inode;
}
__inode_unlink (unlink_inode, parent, name);