diff options
| author | Eric Biggers <ebiggers@google.com> | 2018-01-11 23:30:08 -0500 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-04-08 02:27:19 -0700 |
| commit | 168a90782888affff92b4a4fe950c9e5afca7179 (patch) | |
| tree | bdfd86b1cd4a432c33a0d8c8cbda70aa17fdbea9 /include/linux | |
| parent | 042ae9f4cfbfb555e6de68579870ac3c43594215 (diff) | |
fscrypt: calculate NUL-padding length in one place only
Currently, when encrypting a filename (either a real filename or a
symlink target) we calculate the amount of NUL-padding twice: once
before encryption and once during encryption in fname_encrypt(). It is
needed before encryption to allocate the needed buffer size as well as
calculate the size the symlink target will take up on-disk before
creating the symlink inode. Calculating the size during encryption as
well is redundant.
Remove this redundancy by always calculating the exact size beforehand,
and making fname_encrypt() just add as much NUL padding as is needed to
fill the output buffer.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
