[PATCH v2 14/14] netfs: Fix DIO write retry for filesystems without a ->prepare_write()
ChenXiaoSong
chenxiaosong at chenxiaosong.com
Wed Jun 24 07:21:45 PDT 2026
Looks good. Feel free to add:
Reviewed-by: ChenXiaoSong <chenxiaosong at kylinos.cn>
Tested-by: ChenXiaoSong <chenxiaosong at kylinos.cn>
在 2026/6/24 19:57, David Howells 写道:
> Fix netfs_unbuffered_write() so that it doesn't re-issue a write twice when
> the filesystem doesn't have a ->prepare_write(). The bit of code that does
> the first issue should just be removed as everything it does is done again
> when the loop it's in goes back to the top.
>
> Reported-by: syzbot+3c74b1f0c372e98efc32 at syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=3c74b1f0c372e98efc32
> Tested-by: syzbot+3c74b1f0c372e98efc32 at syzkaller.appspotmail.com
> Signed-off-by: David Howells <dhowells at redhat.com>
> cc: Paulo Alcantara <pc at manguebit.org>
> cc: hongao <hongao at uniontech.com>
> cc: ChenXiaoSong <chenxiaosong at chenxiaosong.com>
> cc: netfs at lists.linux.dev
> cc: linux-fsdevel at vger.kernel.org
> ---
> fs/netfs/direct_write.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/fs/netfs/direct_write.c b/fs/netfs/direct_write.c
> index 25f8ceb15fad..1ff1789016b8 100644
> --- a/fs/netfs/direct_write.c
> +++ b/fs/netfs/direct_write.c
> @@ -190,12 +190,6 @@ static int netfs_unbuffered_write(struct netfs_io_request *wreq)
> stream->prepare_write(subreq);
> __set_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags);
> netfs_stat(&netfs_n_wh_retry_write_subreq);
> - } else {
> - struct iov_iter source;
> -
> - netfs_reset_iter(subreq);
> - source = subreq->io_iter;
> - netfs_reissue_write(stream, subreq, &source);
> }
> }
>
>
--
ChenXiaoSong <chenxiaosong at chenxiaosong.com>
Chinese Homepage: https://chenxiaosong.com
English Homepage: https://chenxiaosong.com/en
More information about the linux-afs
mailing list