diff options
author | Eric Biggers <ebiggers@google.com> | 2019-03-15 22:16:32 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-04-17 00:44:44 +0200 |
commit | ff5d3a97075c65731a46453d36e75b9cf925e165 (patch) | |
tree | 8f45dad94b8d4aa47315eba32133a15f9e91c1cb /fs/crypto/bio.c | |
parent | fscrypt: drop inode argument from fscrypt_get_ctx() (diff) | |
download | linux-ff5d3a97075c65731a46453d36e75b9cf925e165.tar.xz linux-ff5d3a97075c65731a46453d36e75b9cf925e165.zip |
fscrypt: remove WARN_ON_ONCE() when decryption fails
If decrypting a block fails, fscrypt did a WARN_ON_ONCE(). But WARN is
meant for kernel bugs, which this isn't; this could be hit by fuzzers
using fault injection, for example. Also, there is already a proper
warning message logged in fscrypt_do_page_crypto(), so the WARN doesn't
add much.
Just remove the unnessary WARN.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/crypto/bio.c')
-rw-r--r-- | fs/crypto/bio.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index f5b69b9531f6..41dde4578f3b 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -37,12 +37,10 @@ static void __fscrypt_decrypt_bio(struct bio *bio, bool done) int ret = fscrypt_decrypt_page(page->mapping->host, page, PAGE_SIZE, 0, page->index); - if (ret) { - WARN_ON_ONCE(1); + if (ret) SetPageError(page); - } else if (done) { + else if (done) SetPageUptodate(page); - } if (done) unlock_page(page); } |