linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Jiang Ying <jiangying8582@126.com>,
	Wang Long <wanglong19@meituan.com>,
	linux-ext4@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH v2] ext4: fix direct I/O read error
Date: Mon, 29 Jun 2020 08:26:27 +0200	[thread overview]
Message-ID: <22f650fd-6348-30d8-763a-8e03b0772f10@web.de> (raw)
In-Reply-To: <1593400165-114818-1-git-send-email-jiangying8582@126.com>

> Fixes: 9fe55eea7e4b ("Fix race when checking i_size on direct i/o read").

* I suggest to move this tag to the bottom of the commit message.

* This specification is usually preferred without a dot at the line end.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68#n183


> This commit caused ext4 direct I/O read error when the read size is not
> alignment with block size.

Wording alternative:
aligned …


> (1) Make the file that is not alignment with block size:

… a file … aligned …


> (3) Compiling the script:

(3) Compile the source file:


> (4) Exec the script:

(4) Run the test program:


> … Thanks.

I propose to omit this word here.


> ---
>  fs/ext4/inode.c | 6 ++++++

Would you like to add patch version descriptions here?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68#n751> @@ -3821,6 +3821,12 @@ static ssize_t ext4_direct_IO_read(struct kiocb *iocb, struct iov_iter *iter)
>  	struct inode *inode = mapping->host;
>  	size_t count = iov_iter_count(iter);
>  	ssize_t ret;
> +	loff_t offset = iocb->ki_pos;
> +	loff_t size;
> +
> +	size = i_size_read(inode);

How do you think about to use the following source code variant?

+	loff_t size = i_size_read(inode);


> +	if (offset >= size)
> +		return 0;

Will any further fine-tuning matter for this function implementation?

Regards,
Markus

      parent reply	other threads:[~2020-06-29 20:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  3:09 [PATCH v2] ext4: fix direct I/O read error Jiang Ying
2020-06-29  6:22 ` Christoph Hellwig
2020-06-29  6:26 ` Markus Elfring [this message]

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=22f650fd-6348-30d8-763a-8e03b0772f10@web.de \
    --to=markus.elfring@web.de \
    --cc=adilger.kernel@dilger.ca \
    --cc=jiangying8582@126.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=wanglong19@meituan.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;
as well as URLs for NNTP newsgroup(s).