Skip to content

Commit e355b2f

Browse files
um: ubd: Retry buffer read on any kind of error
Should bulk_req_safe_read return an error, we want to retry the read, otherwise, even though no IO will be done, os_write_file might still end up writing garbage to the pipe. Cc: Martyn Welch <martyn.welch@collabora.com> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 6e682d5 commit e355b2f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎arch/um/drivers/ubd_kern.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,11 +1592,11 @@ int io_thread(void *arg)
15921592
&io_remainder_size,
15931593
UBD_REQ_BUFFER_SIZE
15941594
);
1595-
if (n < 0) {
1596-
if (n == -EAGAIN) {
1595+
if (n <= 0) {
1596+
if (n == -EAGAIN)
15971597
ubd_read_poll(-1);
1598-
continue;
1599-
}
1598+
1599+
continue;
16001600
}
16011601

16021602
for (count = 0; count < n/sizeof(struct io_thread_req *); count++) {

0 commit comments

Comments
 (0)