diff options
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index f0bdfd944c44..685c18065c82 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -854,17 +854,25 @@ static void o2net_sendpage(struct o2net_sock_container *sc, | |||
854 | struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num); | 854 | struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num); |
855 | ssize_t ret; | 855 | ssize_t ret; |
856 | 856 | ||
857 | 857 | while (1) { | |
858 | mutex_lock(&sc->sc_send_lock); | 858 | mutex_lock(&sc->sc_send_lock); |
859 | ret = sc->sc_sock->ops->sendpage(sc->sc_sock, | 859 | ret = sc->sc_sock->ops->sendpage(sc->sc_sock, |
860 | virt_to_page(kmalloced_virt), | 860 | virt_to_page(kmalloced_virt), |
861 | (long)kmalloced_virt & ~PAGE_MASK, | 861 | (long)kmalloced_virt & ~PAGE_MASK, |
862 | size, MSG_DONTWAIT); | 862 | size, MSG_DONTWAIT); |
863 | mutex_unlock(&sc->sc_send_lock); | 863 | mutex_unlock(&sc->sc_send_lock); |
864 | if (ret != size) { | 864 | if (ret == size) |
865 | break; | ||
866 | if (ret == (ssize_t)-EAGAIN) { | ||
867 | mlog(0, "sendpage of size %zu to " SC_NODEF_FMT | ||
868 | " returned EAGAIN\n", size, SC_NODEF_ARGS(sc)); | ||
869 | cond_resched(); | ||
870 | continue; | ||
871 | } | ||
865 | mlog(ML_ERROR, "sendpage of size %zu to " SC_NODEF_FMT | 872 | mlog(ML_ERROR, "sendpage of size %zu to " SC_NODEF_FMT |
866 | " failed with %zd\n", size, SC_NODEF_ARGS(sc), ret); | 873 | " failed with %zd\n", size, SC_NODEF_ARGS(sc), ret); |
867 | o2net_ensure_shutdown(nn, sc, 0); | 874 | o2net_ensure_shutdown(nn, sc, 0); |
875 | break; | ||
868 | } | 876 | } |
869 | } | 877 | } |
870 | 878 | ||