mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>
Cc: Chao Yu <yuchao0@huawei.com>, Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com,
	Daeho Jeong <daehojeong@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE
Date: Wed, 15 Jul 2020 09:42:20 -0700	[thread overview]
Message-ID: <20200715164220.GC1167@sol.localdomain> (raw)
In-Reply-To: <CACOAw_xaS7qB22EPsZvHoC=uPiPtqGMAK5cP4Vk20xO21GQ-Kg@mail.gmail.com>

On Wed, Jul 15, 2020 at 07:25:13PM +0900, Daeho Jeong wrote:
> Chao,
> 
> I can't find fscrypt_zeroout_range_inline_crypt() function. Do you
> mean we need to implement this one for inline encryption?
> 
> 2020년 7월 15일 (수) 오후 4:17, Chao Yu <yuchao0@huawei.com>님이 작성:
> >
> > On 2020/7/15 14:54, Daeho Jeong wrote:
> > > You mean we can support ZEROOUT option only for encrypted files of
> > > non-multidevice f2fs,
> > > and return -EOPNOTSUPP in the multidevice case, right now?
> >
> > Yes, something like:
> >
> > f2fs_sec_trim_file()
> >
> > if ((range.flags & F2FS_TRIM_FILE_ZEROOUT) &&
> >         f2fs_encrypted_file() && f2fs_is_multi_device())
> >         return -EOPNOTSUPP;
> >
> >
> > f2fs_secure_erase()
> >
> > if (!ret && (flags & F2FS_TRIM_FILE_ZEROOUT)) {
> >         if (f2fs_encrypted_file()) {
> >                 if (fscrypt_inode_uses_fs_layer_crypto)
> >                         ret = fscrypt_zeroout_range();
> >                 else
> >                         ret = fscrypt_zeroout_range_inline_crypt();
> >         } else {
> >                 ret = blkdev_issue_zeroout();
> >         }
> > }

fscrypt_zeroout_range_inline_crypt() is being added by
"fscrypt: add inline encryption support", which is queued in the fscrypt tree
(the master branch of https://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git).

But that's not actually relevant here because fscrypt_zeroout_range() calls
fscrypt_zeroout_range_inline_crypt() when needed.

Just use fscrypt_zeroout_range().

- Eric

  reply	other threads:[~2020-07-15 16:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13  3:12 Daeho Jeong
2020-07-13 18:11 ` Jaegeuk Kim
2020-07-13 23:34   ` Daeho Jeong
2020-07-14 12:36   ` [f2fs-dev] " Chao Yu
2020-07-15  4:06     ` Daeho Jeong
2020-07-15  6:16       ` Chao Yu
2020-07-15  6:54         ` Daeho Jeong
2020-07-15  7:17           ` Chao Yu
2020-07-15 10:25             ` Daeho Jeong
2020-07-15 16:42               ` Eric Biggers [this message]
2020-07-16  1:04                 ` Chao Yu

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=20200715164220.GC1167@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=daeho43@gmail.com \
    --cc=daehojeong@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.com \
    /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

Powered by JetHome