[PATCH v2 14/14] netfs: Fix DIO write retry for filesystems without a ->prepare_write()

David Howells dhowells at redhat.com
Wed Jun 24 04:57:35 PDT 2026


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);
 		}
 	}
 




More information about the linux-afs mailing list