From: adilger Date: Thu, 7 Nov 2002 23:23:37 +0000 (+0000) Subject: Fix (or a workaround that will hide the real bug) for bug 322. X-Git-Tag: 0.5.17~52 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=a97ba795868a70f6a034ac0337d3ab046d556811;p=fs%2Flustre-release.git Fix (or a workaround that will hide the real bug) for bug 322. We are calling mdc_blocking_ast() to clean up an inode that is already being cleaned up elsewhere. This is the result of ldlm_cli_cancel_unused() being called from two places at the same time: - ll_prepare_recovery()->prepare_mdc()->ldlm_cli_cancel_unused() - ll_clear_inode()->mdc_cancel_unused()->ldlm_cli_cancel_unused() There is still a small race where the ll_clear_inode() RPC could have completed and "inode" is garbage, but since we are in recovery this is highly unlikely. --- diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index f9a870b..01fffd8 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -199,6 +199,10 @@ static int mdc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, /* Invalidate all dentries associated with this inode */ struct inode *inode = data; +#warning "FIXME: what tells us that 'inode' is valid at all?" + if (!(inode->i_state & I_FREEING)) + break; + LASSERT(inode != NULL); LASSERT(data_len == sizeof(*inode)); @@ -209,7 +213,8 @@ static int mdc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, ll_invalidate_inode_pages(inode); } - if ( inode != inode->i_sb->s_root->d_inode ) { + if ( inode != inode->i_sb->s_root->d_inode ) { + /* XXX should this igrab move up 12 lines? */ LASSERT(igrab(inode) == inode); d_delete_aliases(inode); iput(inode);