From b5377787903109dd5aea408e7b3a8e772b2be4f5 Mon Sep 17 00:00:00 2001 From: Basavanagowda Kanur Date: Thu, 26 Feb 2009 13:38:33 +0530 Subject: __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 --- libglusterfs/src/inode.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs/src/inode.c') diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 6c527fc75..c64286d40 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); -- cgit