xfs: fix error handling in xfs_log_mount

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 3, 2009 - 11:06 am

Gitweb:     http://git.kernel.org/linus/264307520b120593ba63c4a23c58dd5e2ec5e822
Commit:     264307520b120593ba63c4a23c58dd5e2ec5e822
Parent:     8e08f6eb34af13b78d379a025e4c9f8612b47b95
Author:     Christoph Hellwig <hch@lst.de>
AuthorDate: Thu Feb 12 19:55:48 2009 +0100
Committer:  Christoph Hellwig <hch@brick.lst.de>
CommitDate: Thu Feb 12 19:55:48 2009 +0100

    xfs: fix error handling in xfs_log_mount
    
    We can't just call xfs_log_unmount_dealloc on any failure because the
    ail thread which is torn down by xfs_log_unmount_dealloc might not
    be initialized yet.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Felix Blyakher <felixb@sgi.com>
    Reported-by: Lachlan McIlroy <lachlan@sgi.com>
---
 fs/xfs/xfs_log.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 493c07f..c8f3008 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -574,7 +574,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;
 
@@ -594,20 +594,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
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
xfs: fix error handling in xfs_log_mount, Linux Kernel Mailing ..., (Fri Apr 3, 11:06 am)