diff options
author | Eric Biggers <ebiggers@google.com> | 2017-04-29 23:27:26 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-04-29 23:27:26 -0400 |
commit | 1bc0af600b011dbbf9bbf39664b858ea2e365729 (patch) | |
tree | fd59ad97664de94f429398d0557aa7289d19fc24 /fs/ext4/namei.c | |
parent | 5052b069acf73866d00077d8bc49983c3ee903e5 (diff) | |
download | op-kernel-dev-1bc0af600b011dbbf9bbf39664b858ea2e365729.zip op-kernel-dev-1bc0af600b011dbbf9bbf39664b858ea2e365729.tar.gz |
ext4: trim return value and 'dir' argument from ext4_insert_dentry()
In the initial implementation of ext4 encryption, the filename was
encrypted in ext4_insert_dentry(), which could fail and also required
access to the 'dir' inode. Since then ext4 filename encryption has been
changed to encrypt the filename earlier, so we can revert the additions
to ext4_insert_dentry().
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 07e5e14..6577a3c 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1869,11 +1869,10 @@ return_result: return res; } -int ext4_insert_dentry(struct inode *dir, - struct inode *inode, - struct ext4_dir_entry_2 *de, - int buf_size, - struct ext4_filename *fname) +void ext4_insert_dentry(struct inode *inode, + struct ext4_dir_entry_2 *de, + int buf_size, + struct ext4_filename *fname) { int nlen, rlen; @@ -1892,7 +1891,6 @@ int ext4_insert_dentry(struct inode *dir, ext4_set_de_type(inode->i_sb, de, inode->i_mode); de->name_len = fname_len(fname); memcpy(de->name, fname_name(fname), fname_len(fname)); - return 0; } /* @@ -1928,11 +1926,8 @@ static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname, return err; } - /* By now the buffer is marked for journaling. Due to crypto operations, - * the following function call may fail */ - err = ext4_insert_dentry(dir, inode, de, blocksize, fname); - if (err < 0) - return err; + /* By now the buffer is marked for journaling */ + ext4_insert_dentry(inode, de, blocksize, fname); /* * XXX shouldn't update any times until successful |