diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-05-06 21:05:05 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-05-24 11:33:10 -0400 |
commit | 524ee36fa4661d745a467c3bba0e1034fd1f4b77 (patch) | |
tree | c14176bd3f02e40f1fbdffc137b6f4d49b8e6d5e | |
parent | b4ed4626a9775cd8cb77209280d24839526f94f2 (diff) |
xfs: Don't reuse the same transaction ID for duplicated transactions.
The transaction ID is written into the log as the unique identifier
for transactions during recover. When duplicating a transaction, we
reuse the log ticket, which means it has the same transaction ID as
the previous transaction.
Rather than regenerating a random transaction ID for the duplicated
transaction, just add one to the current ID so that duplicated
transaction can be easily spotted in the log and during recovery
during problem diagnosis.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
-rw-r--r-- | fs/xfs/xfs_log.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 3038dd52c72a..687b220c6af3 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -360,6 +360,15 @@ xfs_log_reserve( | |||
360 | ASSERT(flags & XFS_LOG_PERM_RESERV); | 360 | ASSERT(flags & XFS_LOG_PERM_RESERV); |
361 | internal_ticket = *ticket; | 361 | internal_ticket = *ticket; |
362 | 362 | ||
363 | /* | ||
364 | * this is a new transaction on the ticket, so we need to | ||
365 | * change the transaction ID so that the next transaction has a | ||
366 | * different TID in the log. Just add one to the existing tid | ||
367 | * so that we can see chains of rolling transactions in the log | ||
368 | * easily. | ||
369 | */ | ||
370 | internal_ticket->t_tid++; | ||
371 | |||
363 | trace_xfs_log_reserve(log, internal_ticket); | 372 | trace_xfs_log_reserve(log, internal_ticket); |
364 | 373 | ||
365 | xlog_grant_push_ail(mp, internal_ticket->t_unit_res); | 374 | xlog_grant_push_ail(mp, internal_ticket->t_unit_res); |