diff mbox series

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

Message ID 9cdd449fc1d63cf2dba17cfa2fa7fb29b8f96a46.1700506526.git.ritesh.list@gmail.com (mailing list archive)
State New
Headers show
Series ext2: Use iomap in buffered-io for regular files and enable large folio support | expand

Commit Message

Ritesh Harjani (IBM) Nov. 20, 2023, 7:05 p.m. UTC
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) <ritesh.list@gmail.com>
---
 fs/ext2/file.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Christoph Hellwig Nov. 21, 2023, 4:39 a.m. UTC | #1
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 <hch@lst.de>
Ritesh Harjani (IBM) Nov. 21, 2023, 5:36 a.m. UTC | #2
Christoph Hellwig <hch@infradead.org> 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 <hch@lst.de>

Thanks!

-ritesh
Christoph Hellwig Nov. 22, 2023, 6:51 a.m. UTC | #3
On Tue, Nov 21, 2023 at 11:06:53AM +0530, Ritesh Harjani wrote:
> Christoph Hellwig <hch@infradead.org> 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?
diff mbox series

Patch

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,