Sfoglia il codice sorgente

net/9p: set error to EREMOTEIO if trans->write returns zero

If trans->write returns 0, p9_write_work goes through the error path, but
sets the error code to zero.

This patch sets the error code to EREMOTEIO if trans->write returns zero
value.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Latchesar Ionkov 18 anni fa
parent
commit
1d6b560238
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      net/9p/mux.c

+ 5 - 1
net/9p/mux.c

@@ -505,8 +505,12 @@ again:
 		return;
 	}
 
-	if (err <= 0)
+	if (err < 0)
+		goto error;
+	else if (err == 0) {
+		err = -EREMOTEIO;
 		goto error;
+	}
 
 	m->wpos += err;
 	if (m->wpos == m->wsize)