From: Eric Biggers <ebiggers@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: linux-fscrypt@vger.kernel.org,
Gabriel Krisman Bertazi <krisman@collabora.com>,
Daniel Rosenberg <drosen@google.com>
Subject: Re: [f2fs-dev] [RFC PATCH 4/4] f2fs: Handle casefolding with Encryption (INCOMPLETE)
Date: Thu, 7 May 2020 19:55:43 -0700 [thread overview]
Message-ID: <20200508025543.GA63151@sol.localdomain> (raw)
In-Reply-To: <20200507075905.953777-5-ebiggers@kernel.org>
On Thu, May 07, 2020 at 12:59:05AM -0700, Eric Biggers wrote:
> -static void init_dent_inode(const struct f2fs_filename *fname,
> +static void init_dent_inode(struct inode *dir, struct inode *inode,
> + const struct f2fs_filename *fname,
> struct page *ipage)
> {
> struct f2fs_inode *ri;
>
> + if (!fname) /* tmpfile case? */
> + return;
> +
> f2fs_wait_on_page_writeback(ipage, NODE, true, true);
>
> /* copy name info. to this inode page */
> ri = F2FS_INODE(ipage);
> ri->i_namelen = cpu_to_le32(fname->disk_name.len);
> memcpy(ri->i_name, fname->disk_name.name, fname->disk_name.len);
> + if (IS_ENCRYPTED(dir)) {
> + file_set_enc_name(inode);
> + /*
> + * Roll-forward recovery doesn't have encryption keys available,
> + * so it can't compute the dirhash for encrypted+casefolded
> + * filenames. Append it to i_name if possible. Else, disable
> + * roll-forward recovery of the dentry (i.e., make fsync'ing the
> + * file force a checkpoint) by setting LOST_PINO.
> + */
> + if (IS_CASEFOLDED(dir)) {
> + if (fname->disk_name.len + sizeof(f2fs_hash_t) <=
> + F2FS_NAME_LEN)
> + put_unaligned(fname->hash,
> + &ri->i_name[fname->disk_name.len]);
Jaegeuk pointed out that we need a cast to 'f2fs_hash_t *' here.
- Eric
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2020-05-08 2:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-07 7:59 [f2fs-dev] [PATCH 0/4] f2fs: rework filename handling Eric Biggers
2020-05-07 7:59 ` [f2fs-dev] [PATCH 1/4] f2fs: don't leak filename in f2fs_try_convert_inline_dir() Eric Biggers
2020-05-08 8:25 ` Chao Yu
2020-05-07 7:59 ` [f2fs-dev] [PATCH 2/4] f2fs: split f2fs_d_compare() from f2fs_match_name() Eric Biggers
2020-05-11 2:47 ` Chao Yu
2020-05-07 7:59 ` [f2fs-dev] [PATCH 3/4] f2fs: rework filename handling Eric Biggers
2020-05-25 8:12 ` Chao Yu
2020-05-25 15:10 ` Jaegeuk Kim
2020-05-07 7:59 ` [f2fs-dev] [RFC PATCH 4/4] f2fs: Handle casefolding with Encryption (INCOMPLETE) Eric Biggers
2020-05-08 2:55 ` Eric Biggers [this message]
2020-05-07 13:09 ` [f2fs-dev] [PATCH 0/4] f2fs: rework filename handling Jaegeuk Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200508025543.GA63151@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=drosen@google.com \
--cc=krisman@collabora.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).