2023-11-20 19:05:46

by Ritesh Harjani (IBM)

[permalink] [raw]
Subject: [RFC 1/3] ext2: Fix ki_pos update for DIO buffered-io fallback case

Commit "filemap: update ki_pos in generic_perform_write", made updating
of ki_pos into common code in generic_perform_write() function.
This also causes generic/091 to fail.

Fixes: 182c25e9c157 ("filemap: update ki_pos in generic_perform_write")
Signed-off-by: Ritesh Harjani (IBM) <[email protected]>
---
fs/ext2/file.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 1039e5bf90af..4ddc36f4dbd4 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -258,7 +258,6 @@ static ssize_t ext2_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
goto out_unlock;
}

- iocb->ki_pos += status;
ret += status;
endbyte = pos + status - 1;
ret2 = filemap_write_and_wait_range(inode->i_mapping, pos,
--
2.41.0



2023-11-21 04:39:40

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [RFC 1/3] ext2: Fix ki_pos update for DIO buffered-io fallback case

On Tue, Nov 21, 2023 at 12:35:19AM +0530, Ritesh Harjani (IBM) wrote:
> Commit "filemap: update ki_pos in generic_perform_write", made updating
> of ki_pos into common code in generic_perform_write() function.
> This also causes generic/091 to fail.
>
> Fixes: 182c25e9c157 ("filemap: update ki_pos in generic_perform_write")

Looks like this really was an in-flight collision with:
fb5de4358e1a ("ext2: Move direct-io to use iomap"). How did we manage
to not notice the failure for months, though?

Otherwise looks good:

Reviewed-by: Christoph Hellwig <[email protected]>

2023-11-21 05:37:18

by Ritesh Harjani (IBM)

[permalink] [raw]
Subject: Re: [RFC 1/3] ext2: Fix ki_pos update for DIO buffered-io fallback case

Christoph Hellwig <[email protected]> writes:

> On Tue, Nov 21, 2023 at 12:35:19AM +0530, Ritesh Harjani (IBM) wrote:
>> Commit "filemap: update ki_pos in generic_perform_write", made updating
>> of ki_pos into common code in generic_perform_write() function.
>> This also causes generic/091 to fail.
>>
>> Fixes: 182c25e9c157 ("filemap: update ki_pos in generic_perform_write")
>
> Looks like this really was an in-flight collision with:
> fb5de4358e1a ("ext2: Move direct-io to use iomap"). How did we manage
> to not notice the failure for months, though?

Yes, it was due to in-flight collision. I found it during this conversion and
also noticed that generic/091 fails on upstream kernel.

>
> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <[email protected]>

Thanks!

-ritesh

2023-11-22 06:51:44

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [RFC 1/3] ext2: Fix ki_pos update for DIO buffered-io fallback case

On Tue, Nov 21, 2023 at 11:06:53AM +0530, Ritesh Harjani wrote:
> Christoph Hellwig <[email protected]> writes:
>
> > On Tue, Nov 21, 2023 at 12:35:19AM +0530, Ritesh Harjani (IBM) wrote:
> >> Commit "filemap: update ki_pos in generic_perform_write", made updating
> >> of ki_pos into common code in generic_perform_write() function.
> >> This also causes generic/091 to fail.
> >>
> >> Fixes: 182c25e9c157 ("filemap: update ki_pos in generic_perform_write")
> >
> > Looks like this really was an in-flight collision with:
> > fb5de4358e1a ("ext2: Move direct-io to use iomap"). How did we manage
> > to not notice the failure for months, though?
>
> Yes, it was due to in-flight collision. I found it during this conversion and
> also noticed that generic/091 fails on upstream kernel.

Maybe ammend the commit message with that information and then it off
for inclusion into 6.7-rc and -stable ASAP?