protocol/server: unlink dentry only for non-root inodes

in server_lookup_cbk, unlink dentry from the crash on receiving
ENOENT from subvolume only for non-root inode. ENOENT can be returned
for root inode if export directory is deleted

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 526 (glusterfsd crash when export dir is deleted and revalidate happens on /)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=526
This commit is contained in:
Anand Avati 2010-01-23 15:18:21 +00:00 committed by Anand V. Avati
parent bc111de015
commit c9a2054973

View File

@ -2456,8 +2456,11 @@ server_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
} else {
if (state->is_revalidate && op_errno == ENOENT) {
inode_unlink (state->loc.inode, state->loc.parent,
state->loc.name);
if (state->loc.inode->ino != 1) {
inode_unlink (state->loc.inode,
state->loc.parent,
state->loc.name);
}
}
gf_log (this->name,