Commit dea96095 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Ben Myers
Browse files

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: default avatarChristoph Hellwig <>
Reviewed-by: default avatarDave Chinner <>
Reviewed-by: default avatarMark Tinguely <>
Signed-off-by: default avatarBen Myers <>
parent 7582df51
......@@ -904,10 +904,22 @@ 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.
struct xfs_log_item *lip = &dqp->q_logitem.qli_item;
dqp->dq_flags &= ~XFS_DQ_DIRTY;
if (lip->li_flags & XFS_LI_IN_AIL)
xfs_trans_ail_delete(mp->m_ail, lip,
return XFS_ERROR(EIO);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment