OSDN Git Service

fscrypt: clean up some BUG_ON()s in block encryption/decryption
authorEric Biggers <ebiggers@google.com>
Mon, 20 May 2019 16:29:42 +0000 (09:29 -0700)
committerEric Biggers <ebiggers@google.com>
Tue, 28 May 2019 17:27:52 +0000 (10:27 -0700)
commiteeacfdc68a104967162dfcba60f53f6f5b62a334
tree13a3375c24a8c9ab9fa14ec9e03560780e8e3e2a
parentf47fcbb2b578bdb213d9ac5875aab56a2034d466
fscrypt: clean up some BUG_ON()s in block encryption/decryption

Replace some BUG_ON()s with WARN_ON_ONCE() and returning an error code,
and move the check for len divisible by FS_CRYPTO_BLOCK_SIZE into
fscrypt_crypt_block() so that it's done for both encryption and
decryption, not just encryption.

Reviewed-by: Chandan Rajendra <chandan@linux.ibm.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/crypto.c