diff options
author | Eric Biggers <ebiggers@google.com> | 2023-03-20 16:39:43 -0700 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2023-03-27 21:15:50 -0700 |
commit | 41b2ad80fdcaafd42fce173cb95847d0cd8614c2 (patch) | |
tree | 633980d206be0ae2ce7215bd46207b0a5a1cf02e /fs/crypto/hooks.c | |
parent | 6f2656eab290f0dd437cd4b2ec956c3519172d3b (diff) | |
download | linux-stable-41b2ad80fdcaafd42fce173cb95847d0cd8614c2.tar.gz linux-stable-41b2ad80fdcaafd42fce173cb95847d0cd8614c2.tar.bz2 linux-stable-41b2ad80fdcaafd42fce173cb95847d0cd8614c2.zip |
fscrypt: 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/20230320233943.73600-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'fs/crypto/hooks.c')
-rw-r--r-- | fs/crypto/hooks.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/crypto/hooks.c b/fs/crypto/hooks.c index 9151934c5086..9e786ae66a13 100644 --- a/fs/crypto/hooks.c +++ b/fs/crypto/hooks.c @@ -345,7 +345,7 @@ const char *fscrypt_get_symlink(struct inode *inode, const void *caddr, int err; /* This is for encrypted symlinks only */ - if (WARN_ON(!IS_ENCRYPTED(inode))) + if (WARN_ON_ONCE(!IS_ENCRYPTED(inode))) return ERR_PTR(-EINVAL); /* If the decrypted target is already cached, just return it. */ |