xfs
[Top] [All Lists]

[PATCH 4/3] xfs: set superblock buffer type correctly

To: xfs@xxxxxxxxxxx
Subject: [PATCH 4/3] xfs: set superblock buffer type correctly
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 21 Jan 2015 13:34:44 +1100
Cc: jack@xxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1421800780-26008-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1421800780-26008-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
From: Dave Chinner <dchinner@xxxxxxxxxx>

When the superblock is modified in a transaction, the commonly
modified fields are not actually copied to the superblock buffer to
avoid the buffer lock becoming a serialisation point. However, there
are some other operations that modify the superblock fields within
the transaction that don't directly log to the superblock but rely
on the changes to be applied during the transaction commit (to
minimise the buffer lock hold time).

When we do this, we fail to mark the buffer log item as being a
superblock buffer and that can lead to the buffer not being marked
with the corect type in the log and hence causing recovery issues.
Fix it by setting the type correctly, similar to xfs_mod_sb()...

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 fs/xfs/xfs_trans.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index fa3135b..eb90cd5 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -472,6 +472,7 @@ xfs_trans_apply_sb_deltas(
                whole = 1;
        }
 
+       xfs_trans_buf_set_type(tp, bp, XFS_BLFT_SB_BUF);
        if (whole)
                /*
                 * Log the whole thing, the fields are noncontiguous.

<Prev in Thread] Current Thread [Next in Thread>