Skip to content

Commit 9a654a8

Browse files
Nirjhar-Roy-0211cmaiolino
authored andcommitted
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>
1 parent c2368fc commit 9a654a8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

fs/xfs/xfs_platform.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
235235

236236
#ifdef XFS_WARN
237237

238+
/*
239+
* Please note that this ASSERT doesn't kill the kernel. It will if the kernel
240+
* has panic_on_warn set.
241+
*/
238242
#define ASSERT(expr) \
239243
(likely(expr) ? (void)0 : asswarn(NULL, #expr, __FILE__, __LINE__))
240244

@@ -245,6 +249,11 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
245249
#endif /* XFS_WARN */
246250
#endif /* DEBUG */
247251

252+
/*
253+
* Use this to catch metadata corruptions that are not caught by block or
254+
* structure verifiers. The reason is that the verifiers check corruptions only
255+
* within the scope of the object being verified.
256+
*/
248257
#define XFS_IS_CORRUPT(mp, expr) \
249258
(unlikely(expr) ? xfs_corruption_error(#expr, XFS_ERRLEVEL_LOW, (mp), \
250259
NULL, 0, __FILE__, __LINE__, \

0 commit comments

Comments
 (0)