From 17d90f01e1f13b8e59b70cd20e9ad25956d4f7b2 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 19 Aug 2025 19:00:21 +0200 Subject: [PATCH] xfs: set REQ_NOINTEGRITY for metadata XFS already does it's own validity checks here. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_buf.c | 9 ++++++++- fs/xfs/xfs_log.c | 3 ++- fs/xfs/xfs_log_recover.c | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index f9ef3b2a332a..b2e47f2d5427 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1326,7 +1326,14 @@ xfs_buf_bio_op( op |= REQ_RAHEAD; } - return op | REQ_META; + /* + * The XFS self-describing metadata contains a crc32, an either + * explicitly or implicitly encoded disk address and the log sequence + * number for each metadata block. Generating and verifying integrity + * metadata in the kernel adds no significant value, but adds additional + * memory allocations, context switches and on-the-wire traffic. + */ + return op | REQ_META | REQ_NOINTEGRITY; } static void diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index c8a57e21a1d3..ecacbad88184 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1645,7 +1645,8 @@ xlog_write_iclog( */ bio_init(&iclog->ic_bio, log->l_targ->bt_bdev, iclog->ic_bvec, howmany(count, PAGE_SIZE), - REQ_OP_WRITE | REQ_META | REQ_SYNC | REQ_IDLE); + REQ_OP_WRITE | REQ_META | REQ_SYNC | REQ_IDLE | + REQ_NOINTEGRITY); iclog->ic_bio.bi_iter.bi_sector = log->l_logBBstart + bno; iclog->ic_bio.bi_end_io = xlog_bio_end_io; iclog->ic_bio.bi_private = iclog; diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index e6ed9e09c027..be09842fcb39 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -138,7 +138,7 @@ xlog_do_io( ASSERT(nbblks > 0); error = xfs_rw_bdev(log->l_targ->bt_bdev, log->l_logBBstart + blk_no, - BBTOB(nbblks), data, op); + BBTOB(nbblks), data, op | REQ_NOINTEGRITY); if (error && !xlog_is_shutdown(log)) { xfs_alert(log->l_mp, "log recovery %s I/O error at daddr 0x%llx len %d error %d", -- 2.51.0