[PATCH 5/5] xfs: fix cil push sequence after log recovery

Mark Tinguely
2014-07-02T14:52:19Z

[-- Attachment #1: xfs-fix-cil-push-seq-after-recovery.patch --]
[-- Type: text/plain, Size: 1203 bytes --]

The CIL pushes are marked complete with transaction
tickets and should be in the the correct sequence order.
The back end of the cil push code uses the ctx->commit_lsn
to make sure all previous pushes are complete before adding
the commit ticket for the current cil push. Because
xlog_cil_init_post_recovery sets the ctx->commit_lsn,
the later pushes can incorrectly think that the first
sequence push is complete and allow out of order cil
completion records to be written to the log. If the
system crashes, the log will be replayed in the
wrong order.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
---
fs/xfs/xfs_log_cil.c | 2 --
1 file changed, 2 deletions(-)

Index: b/fs/xfs/xfs_log_cil.c
===================================================================
--- a/fs/xfs/xfs_log_cil.c
+++ b/fs/xfs/xfs_log_cil.c
@@ -78,8 +78,6 @@ xlog_cil_init_post_recovery(
{
log->l_cilp->xc_ctx->ticket = xlog_cil_ticket_alloc(log);
log->l_cilp->xc_ctx->sequence = 1;
- log->l_cilp->xc_ctx->commit_lsn = xlog_assign_lsn(log->l_curr_cycle,
- log->l_curr_block);
}

/*