xfs: Add comments for usages of some macros.

Add comments explaining when to use XFS_IS_CORRUPT() and ASSERT()

Suggested-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Nirjhar Roy (IBM) 2026-02-20 12:24:01 +05:30 committed by Carlos Maiolino
parent c2368fc89a
commit 9a654a8fa3

View file

@ -235,6 +235,10 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
#ifdef XFS_WARN
/*
* Please note that this ASSERT doesn't kill the kernel. It will if the kernel
* has panic_on_warn set.
*/
#define ASSERT(expr) \
(likely(expr) ? (void)0 : asswarn(NULL, #expr, __FILE__, __LINE__))
@ -245,6 +249,11 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
#endif /* XFS_WARN */
#endif /* DEBUG */
/*
* Use this to catch metadata corruptions that are not caught by block or
* structure verifiers. The reason is that the verifiers check corruptions only
* within the scope of the object being verified.
*/
#define XFS_IS_CORRUPT(mp, expr) \
(unlikely(expr) ? xfs_corruption_error(#expr, XFS_ERRLEVEL_LOW, (mp), \
NULL, 0, __FILE__, __LINE__, \