]> xenbits.xensource.com Git - people/iwj/linux.git/commitdiff
xfs: set superblock buffer type correctly
authorDave Chinner <dchinner@redhat.com>
Wed, 21 Jan 2015 22:30:23 +0000 (09:30 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 22:43:23 +0000 (14:43 -0800)
commit 3443a3bca54588f43286b725d8648d33a38c86f1 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: Jan Kara <jack@suse.cz>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_trans.c

index c812c5c060de1caa7532f1cdcc63766a4a227207..b626f3db67cb0dd1d3cdf704b36e6f3b6a202706 100644 (file)
@@ -474,6 +474,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.