aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dquot.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-04-23 01:58:31 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:24 -0400
commitdea9609527a55b65638a6323894269334dfe6ec5 (patch)
tree841b86d16eee04480852e40414701e61bed6f966 /fs/xfs/xfs_dquot.c
parent7582df516c93046b8d2111a780c69de77f9882fb (diff)
xfs: remove log item from AIL in xfs_qm_dqflush after a shutdown
If a filesystem has been forced shutdown we are never going to write dquots to disk, which means the dquot items will stay in the AIL forever. Currently that is not a problem, but a pending chance requires us to empty the AIL before shutting down the filesystem, in which case this behaviour is lethal. Make sure to remove the log item from the AIL to allow emptying the AIL on shutdown filesystems. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dquot.c')
-rw-r--r--fs/xfs/xfs_dquot.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 1155208fa830..e2f6f7c877db 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -904,10 +904,22 @@ xfs_qm_dqflush(
904 /* 904 /*
905 * This may have been unpinned because the filesystem is shutting 905 * This may have been unpinned because the filesystem is shutting
906 * down forcibly. If that's the case we must not write this dquot 906 * down forcibly. If that's the case we must not write this dquot
907 * to disk, because the log record didn't make it to disk! 907 * to disk, because the log record didn't make it to disk.
908 *
909 * We also have to remove the log item from the AIL in this case,
910 * as we wait for an emptry AIL as part of the unmount process.
908 */ 911 */
909 if (XFS_FORCED_SHUTDOWN(mp)) { 912 if (XFS_FORCED_SHUTDOWN(mp)) {
913 struct xfs_log_item *lip = &dqp->q_logitem.qli_item;
910 dqp->dq_flags &= ~XFS_DQ_DIRTY; 914 dqp->dq_flags &= ~XFS_DQ_DIRTY;
915
916 spin_lock(&mp->m_ail->xa_lock);
917 if (lip->li_flags & XFS_LI_IN_AIL)
918 xfs_trans_ail_delete(mp->m_ail, lip,
919 SHUTDOWN_CORRUPT_INCORE);
920 else
921 spin_unlock(&mp->m_ail->xa_lock);
922
911 xfs_dqfunlock(dqp); 923 xfs_dqfunlock(dqp);
912 return XFS_ERROR(EIO); 924 return XFS_ERROR(EIO);
913 } 925 }