Commit 33699d35 authored by Dave Chinner's avatar Dave Chinner Committed by Jiri Slaby

xfs: set superblock buffer type correctly

commit 3443a3bc upstream.

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()...
Tested-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 7baee9ce
...@@ -485,6 +485,7 @@ xfs_trans_apply_sb_deltas( ...@@ -485,6 +485,7 @@ xfs_trans_apply_sb_deltas(
whole = 1; whole = 1;
} }
xfs_trans_buf_set_type(tp, bp, XFS_BLFT_SB_BUF);
if (whole) if (whole)
/* /*
* Log the whole thing, the fields are noncontiguous. * Log the whole thing, the fields are noncontiguous.
......
Markdown is supported
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