public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] ext2: Fix ki_pos update for DIO buffered-io fallback case
@ 2023-11-22  9:02 Ritesh Harjani (IBM)
  2023-11-22  9:18 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Ritesh Harjani (IBM) @ 2023-11-22  9:02 UTC (permalink / raw)
  To: linux-ext4
  Cc: Jan Kara, linux-fsdevel, Ritesh Harjani (IBM), stable,
	Christoph Hellwig

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.
This happened due to an in-flight collision with:
fb5de4358e1a ("ext2: Move direct-io to use iomap"). I have chosen fixes tag
based on which commit got landed later to upstream kernel.

Fixes: 182c25e9c157 ("filemap: update ki_pos in generic_perform_write")
Cc: stable@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv2] ext2: Fix ki_pos update for DIO buffered-io fallback case
  2023-11-22  9:02 [PATCHv2] ext2: Fix ki_pos update for DIO buffered-io fallback case Ritesh Harjani (IBM)
@ 2023-11-22  9:18 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2023-11-22  9:18 UTC (permalink / raw)
  To: Ritesh Harjani (IBM)
  Cc: linux-ext4, Jan Kara, linux-fsdevel, stable, Christoph Hellwig

On Wed 22-11-23 14:32:15, 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.
> This happened due to an in-flight collision with:
> fb5de4358e1a ("ext2: Move direct-io to use iomap"). I have chosen fixes tag
> based on which commit got landed later to upstream kernel.
> 
> Fixes: 182c25e9c157 ("filemap: update ki_pos in generic_perform_write")
> Cc: stable@vger.kernel.org
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Thanks! I've applied the patch to my tree and will push it to Linus soon.

								Honza

> ---
>  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
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-22  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-22  9:02 [PATCHv2] ext2: Fix ki_pos update for DIO buffered-io fallback case Ritesh Harjani (IBM)
2023-11-22  9:18 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox