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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 15, 2016 at 01:24:01PM -0700, Jaegeuk Kim wrote:
> On Thu, Sep 15, 2016 at 10:28:49AM -0700, Eric Biggers wrote:
> > 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'.
> > 
> > Therefore, make these functions return 0 instead of a length, and make
> > the callers who cared about the return value being a length use
> > 'oname->len' instead.  For consistency also make other callers check for
> > a nonzero result rather than a negative result.
> > 
> > This change also fixes the inconsistency of fname_encrypt() actually
> > already returning 0 on success, not a length like the other filename
> > crypto functions and as documented in its function comment.
> > 
> > Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> 
> Acked-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>

Thanks, applied.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux