mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 05:36:24 +00:00
ocfs2: Retry sendpage() if it returns EAGAIN
Instead of treating EAGAIN, returned from sendpage(), as an error, this patch retries the operation. Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
This commit is contained in:
parent
480214d71f
commit
ce17204ae6
1 changed files with 16 additions and 8 deletions
|
@ -854,17 +854,25 @@ static void o2net_sendpage(struct o2net_sock_container *sc,
|
||||||
struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num);
|
struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num);
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
mutex_lock(&sc->sc_send_lock);
|
mutex_lock(&sc->sc_send_lock);
|
||||||
ret = sc->sc_sock->ops->sendpage(sc->sc_sock,
|
ret = sc->sc_sock->ops->sendpage(sc->sc_sock,
|
||||||
virt_to_page(kmalloced_virt),
|
virt_to_page(kmalloced_virt),
|
||||||
(long)kmalloced_virt & ~PAGE_MASK,
|
(long)kmalloced_virt & ~PAGE_MASK,
|
||||||
size, MSG_DONTWAIT);
|
size, MSG_DONTWAIT);
|
||||||
mutex_unlock(&sc->sc_send_lock);
|
mutex_unlock(&sc->sc_send_lock);
|
||||||
if (ret != size) {
|
if (ret == size)
|
||||||
|
break;
|
||||||
|
if (ret == (ssize_t)-EAGAIN) {
|
||||||
|
mlog(0, "sendpage of size %zu to " SC_NODEF_FMT
|
||||||
|
" returned EAGAIN\n", size, SC_NODEF_ARGS(sc));
|
||||||
|
cond_resched();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
mlog(ML_ERROR, "sendpage of size %zu to " SC_NODEF_FMT
|
mlog(ML_ERROR, "sendpage of size %zu to " SC_NODEF_FMT
|
||||||
" failed with %zd\n", size, SC_NODEF_ARGS(sc), ret);
|
" failed with %zd\n", size, SC_NODEF_ARGS(sc), ret);
|
||||||
o2net_ensure_shutdown(nn, sc, 0);
|
o2net_ensure_shutdown(nn, sc, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue