[PATCH] Check if AIL has been started before stopping it

Christoph Hellwig hch at infradead.org
Tue Feb 10 04:12:28 CST 2009


On Tue, Feb 10, 2009 at 12:27:06PM +1100, Lachlan McIlroy wrote:
> A failure during mount can result in shutting down the AIL when
> it may not have been started up yet.

The right fix is to not call xfsaild_stop in that case.

Something like this should fix your problem:


Index: xfs/fs/xfs/xfs_log.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log.c	2009-02-10 11:10:41.804069754 +0100
+++ xfs/fs/xfs/xfs_log.c	2009-02-10 11:10:58.339943990 +0100
@@ -575,7 +575,7 @@ xfs_log_mount(
 	error = xfs_trans_ail_init(mp);
 	if (error) {
 		cmn_err(CE_WARN, "XFS: AIL initialisation failed: error %d", error);
-		goto error;
+		goto out_free_log;
 	}
 	mp->m_log->l_ailp = mp->m_ail;
 
@@ -595,20 +595,22 @@ xfs_log_mount(
 			mp->m_flags |= XFS_MOUNT_RDONLY;
 		if (error) {
 			cmn_err(CE_WARN, "XFS: log mount/recovery failed: error %d", error);
-			goto error;
+			goto out_destroy_ail;
 		}
 	}
 
 	/* Normal transactions can now occur */
 	mp->m_log->l_flags &= ~XLOG_ACTIVE_RECOVERY;
 
-	/* End mounting message in xfs_log_mount_finish */
 	return 0;
-error:
-	xfs_log_unmount_dealloc(mp);
+
+out_destroy_ail:
+	xfs_trans_ail_destroy(mp);
+out_free_log:
+	xlog_dealloc_log(mp->m_log);
 out:
 	return error;
-}	/* xfs_log_mount */
+}
 
 /*
  * Finish the recovery of the file system.  This is separate from




More information about the xfs mailing list