[PATCH 02/18] xfs: pass shutdown method into xfs_trans_ail_delete_bulk

Mark Tinguely tinguely at sgi.com
Fri Apr 13 12:40:46 CDT 2012


On 04/13/12 07:10, Dave Chinner wrote:
> From: Dave Chinner<dchinner at redhat.com>
>
> xfs_trans_ail_delete_bulk() can be called from different contexts so
> if the item is not in the AIL we need different shutdown for each
> context.  Pass in the shutdown method needed so the correct action
> can be taken.
>
> Signed-off-by: Dave Chinner<dchinner at redhat.com>
> Reviewed-by: Christoph Hellwig<hch at lst.de>
> Reviewed-by: Mark Tinguely<tinguely at sgi.com>



These items in my copy of Christoph's xfsbufd series are not resolved in 
this patch:

In "[01/10] xfs: remove log item from AIL in xfs_qm_dqflush after a 
shutdown" a xfs_trans_ail_delete() has been added:

Index: xfs/fs/xfs/xfs_dquot.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dquot.c	2012-02-23 17:52:53.916002428 -0800
+++ xfs/fs/xfs/xfs_dquot.c	2012-02-23 17:53:01.829335739 -0800
@@ -904,10 +904,21 @@ xfs_qm_dqflush(
  	/*
  	 * This may have been unpinned because the filesystem is shutting
  	 * down forcibly. If that's the case we must not write this dquot
-	 * to disk, because the log record didn't make it to disk!
+	 * to disk, because the log record didn't make it to disk.
+	 *
+	 * We also have to remove the log item from the AIL in this case,
+	 * as we wait for an emptry AIL as part of the unmount process.
  	 */
  	if (XFS_FORCED_SHUTDOWN(mp)) {
+		struct xfs_log_item	*lip = &dqp->q_logitem.qli_item;
  		dqp->dq_flags &= ~XFS_DQ_DIRTY;
+
+		spin_lock(&mp->m_ail->xa_lock);
+		if (lip->li_flags & XFS_LI_IN_AIL)
+			xfs_trans_ail_delete(mp->m_ail, lip);
+		else
+			spin_unlock(&mp->m_ail->xa_lock);

                       ====
In "[02/10] xfs: remove log item from AIL in xfs_iflush after a 
shutdown", he added another xfs_iflush_abort(). That is not converted 
with a boolean in this series:


Index: xfs/fs/xfs/xfs_sync.c
===================================================================
--- xfs.orig/fs/xfs/xfs_sync.c	2012-03-16 12:44:57.707030619 +0100
+++ xfs/fs/xfs/xfs_sync.c	2012-03-16 12:47:03.697032954 +0100
@@ -783,6 +783,7 @@ restart:
  		goto reclaim;
  	if (XFS_FORCED_SHUTDOWN(ip->i_mount)) {
  		xfs_iunpin_wait(ip);
+		xfs_iflush_abort(ip);

Thank-you,

--Mark Tinguely <tinguely at sgi.com>



More information about the xfs mailing list