erofs-utils: mount: nbd: retry indefinitely on network I/O errors
PATCH 1/1 erofs-utils: mount: nbd: retry indefinitely on network I/O errors
Due to an NBD protocol limitation, the status code for erofs_nbd_send_reply_header() has already been sent before the data arrives.
A better solution will be considered later.
Signed-off-by Gao Xiang <[email protected]>
--- mount/main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
mount/main.c +3 -5
@@ -596,11 +596,9 @@ static void *erofsmount_nbd_loopfn(void *arg)erofs_nbd_send_reply_header (ctx->sk.fd, rq.cookie,0 ); pos = rq.from; - rem =erofs_io_sendfile (&ctx->sk, &ctx->vd, &pos, rq.len); -if (rem <0 ) { - err = -errno; -break ; - } +do { + rem =erofs_io_sendfile (&ctx->sk, &ctx->vd, &pos, rq.len); + }while (rem <0 ); err =__erofs_0write (ctx->sk.fd, rem);if (err) {if (err >0 )
Signature · 1 line
2.43.5