diff --git a/fs/netfs/read_collect.c b/fs/netfs/read_collect.c index b18c65ba5580..079ba61e24d1 100644 --- a/fs/netfs/read_collect.c +++ b/fs/netfs/read_collect.c @@ -512,9 +512,13 @@ void netfs_read_subreq_terminated(struct netfs_io_subrequest *subreq, __set_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags); __clear_bit(NETFS_SREQ_NO_PROGRESS, &subreq->flags); set_bit(NETFS_RREQ_NEED_RETRY, &rreq->flags); + if (!was_async) + cond_resched(); } else if (!__test_and_set_bit(NETFS_SREQ_NO_PROGRESS, &subreq->flags)) { __set_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags); set_bit(NETFS_RREQ_NEED_RETRY, &rreq->flags); + if (!was_async) + cond_resched(); } else { __set_bit(NETFS_SREQ_FAILED, &subreq->flags); error = -ENODATA;