Whamcloud - gitweb
Fix (or a workaround that will hide the real bug) for bug 322.
authoradilger <adilger>
Thu, 7 Nov 2002 23:23:37 +0000 (23:23 +0000)
committeradilger <adilger>
Thu, 7 Nov 2002 23:23:37 +0000 (23:23 +0000)
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.

lustre/mdc/mdc_request.c

index f9a870b..01fffd8 100644 (file)
@@ -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);