On Mon, Jun 01, 2015 at 12:59:10PM +0300, Dmitry Monakhov wrote:
Theodore Ts'o [off-list ref] writes:
quoted
On Fri, May 29, 2015 at 04:44:29PM -0400, Theodore Ts'o wrote:
quoted
I don't think that's the right way to go. We should add checks to
ext4_file_open, sure. But the problem is that i_crypt_info can get
set to NULL after the file is succesfully opened. So we need to
handle i_crypt_info being NULL everywhere. So the BUG_ON() in
ext4_get_crypto_ctx() needs to be replaced with:
if (ci == NULL)
return ERR_PTR(-ENOKEY);
This is what I had in mind....
ACK. with one note, you forget to convert all callers of
ext4_get_crypto_ctx() to new error convention. Please see patch below.
Thanks for pointing that out! Fixed.
- Ted