]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: RT bitmap and summary buffers are not typed
authorDave Chinner <dchinner@redhat.com>
Wed, 17 Feb 2016 06:08:02 +0000 (17:08 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 17 Feb 2016 06:08:02 +0000 (17:08 +1100)
Source kernel commit f67ca6eca89cddd355c83639a90109e245f9d5a7

When logging buffers, we attach a type to them that follows the
buffer all the way into the log and is used to identify the buffer
contents in log recovery. Both the realtime summary buffers and the
bitmap buffers do not have types defined or set, so when we try to
log them we see assert failure:

XFS: Assertion failed: (bip->bli_flags & XFS_BLI_STALE) || (xfs_blft_from_flags(&bip->__bli_format) > XFS_BLFT_UNKNOWN_BUF && xfs_blft_from_flags(&bip->__bli_format) < XFS_BLFT_MAX_BUF), file: fs/xfs/xfs_buf_item.c, line: 294

Fix this by adding buffer log format types for these buffers, and
add identification support into log recovery for them. Only build the log
recovery support if CONFIG_XFS_RT=y - we can't get into log recovery for real
time filesystems if support is not built into the kernel, and this avoids
potential build problems.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Tested-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_log_format.h
libxfs/xfs_rtbitmap.c

index db8ceebf44e69ca01e6f8bf7533621f81df63a13..c8603459224cb8fd3dac7fa0719944c6bea384a2 100644 (file)
@@ -495,6 +495,8 @@ enum xfs_blft {
        XFS_BLFT_ATTR_LEAF_BUF,
        XFS_BLFT_ATTR_RMT_BUF,
        XFS_BLFT_SB_BUF,
+       XFS_BLFT_RTBITMAP_BUF,
+       XFS_BLFT_RTSUMMARY_BUF,
        XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS),
 };
 
index 5648ea51e63b69d1f6f5f8fec88868f9b04a3429..3e61eb2a9bfb810ce394582742de66a6bdbc66b4 100644 (file)
@@ -66,6 +66,9 @@ xfs_rtbuf_get(
                                   mp->m_bsize, 0, &bp, NULL);
        if (error)
                return error;
+
+       xfs_trans_buf_set_type(tp, bp, issum ? XFS_BLFT_RTSUMMARY_BUF
+                                            : XFS_BLFT_RTBITMAP_BUF);
        *bpp = bp;
        return 0;
 }