btrfs: setup qstr from dentrys using fscrypt helper
authorSweet Tea Dorminy <sweettea-kernel@dorminy.me>
Thu, 20 Oct 2022 16:58:26 +0000 (12:58 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:43 +0000 (18:00 +0100)
commitab3c5c18e8fa3f8ea116016095d25adab466cd39
tree0df3a5526d5edcdf3161872a4c6f3086dc3a7bd2
parente43eec81c5167b655b72c781b0e75e62a05e415e
btrfs: setup qstr from dentrys using fscrypt helper

Most places where we get a struct qstr, we are doing so from a dentry.
With fscrypt, the dentry's name may be encrypted on-disk, so fscrypt
provides a helper to convert a dentry name to the appropriate disk name
if necessary. Convert each of the dentry name accesses to use
fscrypt_setup_filename(), then convert the resulting fscrypt_name back
to an unencrypted qstr. This does not work for nokey names, but the
specific locations that could spawn nokey names are noted.

At present, since there are no encrypted directories, nothing goes down
the filename encryption paths.

Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/inode.c
fs/btrfs/transaction.c
fs/btrfs/tree-log.c