summaryrefslogtreecommitdiffstats
path: root/fs/verity/hash_algs.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2023-03-28 06:03:26 +0200
committerEric Biggers <ebiggers@google.com>2023-04-12 04:23:15 +0200
commit8eb8af4b3df5965dc65a24a32768043f39d82d59 (patch)
treef680ac37d09ca342cb5598bd8149c8335933f18c /fs/verity/hash_algs.c
parentfs-verity: simplify sysctls with register_sysctl() (diff)
downloadlinux-8eb8af4b3df5965dc65a24a32768043f39d82d59.tar.xz
linux-8eb8af4b3df5965dc65a24a32768043f39d82d59.zip
fsverity: use WARN_ON_ONCE instead of WARN_ON
As per Linus's suggestion (https://lore.kernel.org/r/CAHk-=whefxRGyNGzCzG6BVeM=5vnvgb-XhSeFJVxJyAxAF8XRA@mail.gmail.com), use WARN_ON_ONCE instead of WARN_ON. This barely adds any extra overhead, and it makes it so that if any of these ever becomes reachable (they shouldn't, but that's the point), the logs can't be flooded. Link: https://lore.kernel.org/r/20230406181542.38894-1-ebiggers@kernel.org Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'fs/verity/hash_algs.c')
-rw-r--r--fs/verity/hash_algs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/verity/hash_algs.c b/fs/verity/hash_algs.c
index 13fcf31be844..ea00dbedf756 100644
--- a/fs/verity/hash_algs.c
+++ b/fs/verity/hash_algs.c
@@ -84,9 +84,9 @@ struct fsverity_hash_alg *fsverity_get_hash_alg(const struct inode *inode,
}
err = -EINVAL;
- if (WARN_ON(alg->digest_size != crypto_ahash_digestsize(tfm)))
+ if (WARN_ON_ONCE(alg->digest_size != crypto_ahash_digestsize(tfm)))
goto err_free_tfm;
- if (WARN_ON(alg->block_size != crypto_ahash_blocksize(tfm)))
+ if (WARN_ON_ONCE(alg->block_size != crypto_ahash_blocksize(tfm)))
goto err_free_tfm;
err = mempool_init_kmalloc_pool(&alg->req_pool, 1,