* Re: [PATCH v2] ext4: fix direct I/O read error
[not found] <1593400165-114818-1-git-send-email-jiangying8582@126.com>
@ 2020-06-29 6:26 ` Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2020-06-29 6:26 UTC (permalink / raw)
To: Jiang Ying, Wang Long, linux-ext4
Cc: linux-kernel, kernel-janitors, Andreas Dilger, Theodore Ts'o
> 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-29 6:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1593400165-114818-1-git-send-email-jiangying8582@126.com>
2020-06-29 6:26 ` [PATCH v2] ext4: fix direct I/O read error Markus Elfring
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).