Linux FSCRYPT development
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Eric Biggers <ebiggers3@gmail.com>, linux-fscrypt@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>, Eric Biggers <ebiggers@google.com>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-ext4@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH 4/4] f2fs: don't bother checking for encryption key in ->write_iter()
Date: Tue, 23 May 2017 21:39:13 +0800	[thread overview]
Message-ID: <6016f168-9c2b-e7a6-4d21-9b40c4cb6edc@kernel.org> (raw)
In-Reply-To: <20170523003945.14279-5-ebiggers3@gmail.com>

On 2017/5/23 8:39, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> Since only an open file can be written to, and we only allow open()ing
> an encrypted file when its key is available, there is no need to check
> for the key again before permitting each ->write_iter().
> 
> This code was also broken in that it wouldn't actually have failed if
> the key was in fact unavailable.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Acked-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> ---
>  fs/f2fs/file.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index ff4db3efc0ac..3ccc63089a47 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2318,11 +2318,6 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
>  	struct blk_plug plug;
>  	ssize_t ret;
>  
> -	if (f2fs_encrypted_inode(inode) &&
> -				!fscrypt_has_encryption_key(inode) &&
> -				fscrypt_get_encryption_info(inode))
> -		return -EACCES;
> -
>  	inode_lock(inode);
>  	ret = generic_write_checks(iocb, from);
>  	if (ret > 0) {
> 

  reply	other threads:[~2017-05-23 13:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23  0:39 [PATCH 0/4] fscrypt: remove checks for encryption key after file open Eric Biggers
2017-05-23  0:39 ` [PATCH 1/4] ext4: don't bother checking for encryption key in ->mmap() Eric Biggers
2017-06-23 23:46   ` Theodore Ts'o
2017-05-23  0:39 ` [PATCH 2/4] f2fs: " Eric Biggers
2017-05-23 13:38   ` [f2fs-dev] " Chao Yu
2017-05-23  0:39 ` [PATCH 3/4] ubifs: " Eric Biggers
2017-05-23 14:14   ` Richard Weinberger
2017-06-23 16:09     ` Theodore Ts'o
2017-06-23 17:18       ` Eric Biggers
2017-06-23 17:20         ` Richard Weinberger
2017-06-23 17:28           ` Theodore Ts'o
2017-05-23  0:39 ` [PATCH 4/4] f2fs: don't bother checking for encryption key in ->write_iter() Eric Biggers
2017-05-23 13:39   ` Chao Yu [this message]
2017-05-23  5:56 ` [PATCH 0/4] fscrypt: remove checks for encryption key after file open David Gstir

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=6016f168-9c2b-e7a6-4d21-9b40c4cb6edc@kernel.org \
    --to=chao@kernel.org \
    --cc=ebiggers3@gmail.com \
    --cc=ebiggers@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tytso@mit.edu \
    /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