aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2016-02-09 00:41:31 -0500
committerDave Chinner <david@fromorbit.com>2016-02-09 00:41:31 -0500
commitf67ca6eca89cddd355c83639a90109e245f9d5a7 (patch)
treeca04f23d57196375a13a7bf4375062964d17d3f6
parent4b680afb42b9e1b504444583098401a00e63ed3c (diff)
xfs: RT bitmap and summary buffers are not typed
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>
-rw-r--r--fs/xfs/libxfs/xfs_log_format.h2
-rw-r--r--fs/xfs/libxfs/xfs_rtbitmap.c3
-rw-r--r--fs/xfs/xfs_log_recover.c7
3 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h
index 265314690415..1be26ecdbebf 100644
--- a/fs/xfs/libxfs/xfs_log_format.h
+++ b/fs/xfs/libxfs/xfs_log_format.h
@@ -495,6 +495,8 @@ enum xfs_blft {
495 XFS_BLFT_ATTR_LEAF_BUF, 495 XFS_BLFT_ATTR_LEAF_BUF,
496 XFS_BLFT_ATTR_RMT_BUF, 496 XFS_BLFT_ATTR_RMT_BUF,
497 XFS_BLFT_SB_BUF, 497 XFS_BLFT_SB_BUF,
498 XFS_BLFT_RTBITMAP_BUF,
499 XFS_BLFT_RTSUMMARY_BUF,
498 XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS), 500 XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS),
499}; 501};
500 502
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index 9b59ffa1fc19..377a2e6552f3 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -71,6 +71,9 @@ xfs_rtbuf_get(
71 mp->m_bsize, 0, &bp, NULL); 71 mp->m_bsize, 0, &bp, NULL);
72 if (error) 72 if (error)
73 return error; 73 return error;
74
75 xfs_trans_buf_set_type(tp, bp, issum ? XFS_BLFT_RTSUMMARY_BUF
76 : XFS_BLFT_RTBITMAP_BUF);
74 *bpp = bp; 77 *bpp = bp;
75 return 0; 78 return 0;
76} 79}
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index da37beb76f6e..afdd326df923 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2473,6 +2473,13 @@ xlog_recover_validate_buf_type(
2473 } 2473 }
2474 bp->b_ops = &xfs_sb_buf_ops; 2474 bp->b_ops = &xfs_sb_buf_ops;
2475 break; 2475 break;
2476#ifdef CONFIG_XFS_RT
2477 case XFS_BLFT_RTBITMAP_BUF:
2478 case XFS_BLFT_RTSUMMARY_BUF:
2479 /* no verification of RT buffers is done */
2480 bp->b_ops = NULL;
2481 break;
2482#endif /* CONFIG_XFS_RT */
2476 default: 2483 default:
2477 xfs_warn(mp, "Unknown buffer type %d!", 2484 xfs_warn(mp, "Unknown buffer type %d!",
2478 xfs_blft_from_flags(buf_f)); 2485 xfs_blft_from_flags(buf_f));