]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
xfs: Add comments for usages of some macros.
authorNirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Fri, 20 Feb 2026 06:54:01 +0000 (12:24 +0530)
committerCarlos Maiolino <cem@kernel.org>
Wed, 25 Feb 2026 12:58:49 +0000 (13:58 +0100)
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>
fs/xfs/xfs_platform.h

index 1e59bf94d1f232f09ccf1929ae07410de68dd13b..59a33c60e0ca8180da27bf1720ddc88517e353a1 100644 (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__, \