diff options
author | Eric Biggers <ebiggers@google.com> | 2023-03-27 21:03:26 -0700 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2023-04-11 19:23:15 -0700 |
commit | 8eb8af4b3df5965dc65a24a32768043f39d82d59 (patch) | |
tree | f680ac37d09ca342cb5598bd8149c8335933f18c /fs/verity/open.c | |
parent | 1238c8b91c5aca6dd13bccb1b4dc716718e7bfac (diff) | |
download | lwn-8eb8af4b3df5965dc65a24a32768043f39d82d59.tar.gz lwn-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/open.c')
-rw-r--r-- | fs/verity/open.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/verity/open.c b/fs/verity/open.c index 9366b441d01c..52048b7630dc 100644 --- a/fs/verity/open.c +++ b/fs/verity/open.c @@ -83,7 +83,7 @@ int fsverity_init_merkle_tree_params(struct merkle_tree_params *params, params->log_blocks_per_page = PAGE_SHIFT - log_blocksize; params->blocks_per_page = 1 << params->log_blocks_per_page; - if (WARN_ON(!is_power_of_2(params->digest_size))) { + if (WARN_ON_ONCE(!is_power_of_2(params->digest_size))) { err = -EINVAL; goto out_err; } |