From: Kari Argillander <kari.argillander@gmail.com>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 4/4] fs/ntfs3: Update valid size if -EIOCBQUEUED
Date: Wed, 27 Oct 2021 00:31:53 +0300 [thread overview]
Message-ID: <20211026213153.yvddqfglffaojbqm@kari-VirtualBox> (raw)
In-Reply-To: <600c92df-35e9-2686-52f3-5129ccf30e5e@paragon-software.com>
On Mon, Oct 25, 2021 at 07:59:56PM +0300, Konstantin Komarov wrote:
> Update valid size if write is still in I/O queue.
> Fixes xfstest generic/240
generic/240 [21:23:16][ 17.933690] run fstests generic/240 at 2021-10-26 21:23:16
[21:23:18] 2s
Ran: generic/240
Passed all 1 tests
> Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
>
> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
> ---
> fs/ntfs3/inode.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
> index 859951d785cb..c211c64e6b17 100644
> --- a/fs/ntfs3/inode.c
> +++ b/fs/ntfs3/inode.c
> @@ -757,6 +757,7 @@ static ssize_t ntfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
> loff_t vbo = iocb->ki_pos;
> loff_t end;
> int wr = iov_iter_rw(iter) & WRITE;
> + size_t iter_count = iov_iter_count(iter);
> loff_t valid;
> ssize_t ret;
>
> @@ -770,10 +771,14 @@ static ssize_t ntfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
> wr ? ntfs_get_block_direct_IO_W
> : ntfs_get_block_direct_IO_R);
>
> - if (ret <= 0)
> + if (ret > 0)
> + end = vbo + ret;
> + else if (wr && -EIOCBQUEUED == ret)
ret == -EIOCBQUEUED
> + end = vbo + iter_count;
Use iov_iter_count() instead of tmp var?
> + else {
Take brackets off.
> goto out;
> + }
>
> - end = vbo + ret;
> valid = ni->i_valid;
> if (wr) {
> if (end > valid && !S_ISBLK(inode->i_mode)) {
> --
> 2.33.0
>
>
>
next prev parent reply other threads:[~2021-10-26 21:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 16:57 [PATCH 0/4] fs/ntfs3: Various fixes for xfstests problems Konstantin Komarov
2021-10-25 16:58 ` [PATCH 1/4] fs/ntfs3: In function ntfs_set_acl_ex do not change inode->i_mode if called from function ntfs_init_acl Konstantin Komarov
2021-10-25 17:13 ` Joe Perches
2021-10-26 18:40 ` Kari Argillander
2021-10-25 16:58 ` [PATCH 2/4] fs/ntfs3: Fix fiemap + fix shrink file size (to remove preallocated space) Konstantin Komarov
2021-10-26 21:18 ` Kari Argillander
2021-10-25 16:59 ` [PATCH 3/4] fs/ntfs3: Check new size for limits Konstantin Komarov
2021-10-26 21:22 ` Kari Argillander
2021-10-25 16:59 ` [PATCH 4/4] fs/ntfs3: Update valid size if -EIOCBQUEUED Konstantin Komarov
2021-10-26 21:31 ` Kari Argillander [this message]
2021-10-26 21:37 ` [PATCH 0/4] fs/ntfs3: Various fixes for xfstests problems Kari Argillander
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=20211026213153.yvddqfglffaojbqm@kari-VirtualBox \
--to=kari.argillander@gmail.com \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
/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