lkml.org 
[lkml]   [2022]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC 5/7] fs/xfs: support `DISABLE_FS_CSUM_VERIFICATION` config option
Date
From: Hrutvik Kanabar <hrutvik@google.com>

When `DISABLE_FS_CSUM_VERIFICATION` is enabled, return truthy value for
`xfs_verify_cksum`, which is the key function implementing checksum
verification for XFS.

Signed-off-by: Hrutvik Kanabar <hrutvik@google.com>
---
fs/xfs/libxfs/xfs_cksum.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_cksum.h b/fs/xfs/libxfs/xfs_cksum.h
index 999a290cfd72..ba55b1afa382 100644
--- a/fs/xfs/libxfs/xfs_cksum.h
+++ b/fs/xfs/libxfs/xfs_cksum.h
@@ -76,7 +76,10 @@ xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
{
uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);

- return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc);
+ if (IS_ENABLED(CONFIG_DISABLE_FS_CSUM_VERIFICATION))
+ return 1;
+ else
+ return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc);
}

#endif /* _XFS_CKSUM_H */
--
2.38.0.413.g74048e4d9e-goog
\
 
 \ /
  Last update: 2022-10-14 10:51    [W:0.107 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site