Thread (6 messages) flat view 6 messages, 3 authors, 2016-09-15

Re: [PATCH] fscrypto: make filename crypto functions return 0 on success

From: Eric Biggers <hidden>
Date: 2016-09-15 02:55:11
Also in: linux-f2fs-devel, linux-fsdevel

On Wed, Sep 14, 2016 at 05:10:21PM -0700, Jaegeuk Kim wrote:
Hi Eric,

On Wed, Sep 14, 2016 at 04:00:45PM -0700, Eric Biggers wrote:
quoted
Several filename crypto functions: fname_decrypt(),
fscrypt_fname_disk_to_usr(), and fscrypt_fname_usr_to_disk(), returned
the output length on success or -errno on failure.  However, the output
length was redundant with the value written to 'oname->len'.  It is also
potentially error-prone to make callers have to check for '< 0' instead
of '!= 0'.
At a glance, you missed some places like
- fscrypt_fname_usr_to_disk() in ext4_symlink() and f2fs_symlink()
- fscrypt_fname_disk_to_usr() in dx_show_leaf() and f2fs_fill_dentries()
Those callers don't have to be updated because they only check for an error
value --- they don't use the return value as a length.  I did check all the
callers of fscrypt_fname_{usr_to_disk,disk_to_usr()}, and only the three I
update in the patch used the return value as a length.

Eric
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help