From 2f61830ae33e2944ad66bb8bb40916f534b2e494 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 12 Apr 2015 00:56:26 -0400 Subject: ext4 crypto: teach ext4_htree_store_dirent() to store decrypted filenames For encrypted directories, we need to pass in a separate parameter for the decrypted filename, since the directory entry contains the encrypted filename. Signed-off-by: Theodore Ts'o --- fs/ext4/inline.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fs/ext4/inline.c') diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 8b64d715e476..661f0b8dcfe0 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1327,6 +1327,7 @@ int htree_inlinedir_to_tree(struct file *dir_file, struct ext4_iloc iloc; void *dir_buf = NULL; struct ext4_dir_entry_2 fake; + struct ext4_str tmp_str; ret = ext4_get_inode_loc(inode, &iloc); if (ret) @@ -1398,8 +1399,10 @@ int htree_inlinedir_to_tree(struct file *dir_file, continue; if (de->inode == 0) continue; - err = ext4_htree_store_dirent(dir_file, - hinfo->hash, hinfo->minor_hash, de); + tmp_str.name = de->name; + tmp_str.len = de->name_len; + err = ext4_htree_store_dirent(dir_file, hinfo->hash, + hinfo->minor_hash, de, &tmp_str); if (err) { count = err; goto out; -- cgit v1.2.3