From: Andrew Deason Date: Wed, 9 Sep 2009 14:22:02 +0000 (-0500) Subject: Do not respond to SYNC_COM_CHANNEL_CLOSE requests X-Git-Tag: openafs-devel-1_5_63~10 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=46f7bbb19dbb697e626a20363ff23ad2fe0ee4c0;p=packages%2Fo%2Fopenafs.git Do not respond to SYNC_COM_CHANNEL_CLOSE requests SYNC clients, when closing a channel, send a SYNC_COM_CHANNEL_CLOSE command, and immediately disconnect before waiting for a response. So, don't send a SYNC response, since by the time we send it, the other end will most likely have already hung up, causing a lot of needless 'SYNC_putRes: write failed' messages whenever a SYNC channel is closed (e.g. when a demand-salvage finishes). Reviewed-on: http://gerrit.openafs.org/434 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/vol/fssync-server.c b/src/vol/fssync-server.c index d59605622..482bd24e0 100644 --- a/src/vol/fssync-server.c +++ b/src/vol/fssync-server.c @@ -360,7 +360,10 @@ FSYNC_com(osi_socket fd) if (com.hdr.command == SYNC_COM_CHANNEL_CLOSE) { res.hdr.response = SYNC_OK; res.hdr.flags |= SYNC_FLAG_CHANNEL_SHUTDOWN; - goto respond; + + /* don't respond, just drop; senders of SYNC_COM_CHANNEL_CLOSE + * never wait for a response. */ + goto done; } res.hdr.com_seq = com.hdr.com_seq; @@ -400,6 +403,8 @@ FSYNC_com(osi_socket fd) respond: SYNC_putRes(&fssync_server_state, fd, &res); + + done: if (res.hdr.flags & SYNC_FLAG_CHANNEL_SHUTDOWN) { FSYNC_Drop(fd); } diff --git a/src/vol/salvsync-server.c b/src/vol/salvsync-server.c index c7bc09b0b..0edcb8cb6 100644 --- a/src/vol/salvsync-server.c +++ b/src/vol/salvsync-server.c @@ -431,7 +431,10 @@ SALVSYNC_com(osi_socket fd) if (com.hdr.command == SYNC_COM_CHANNEL_CLOSE) { res.hdr.response = SYNC_OK; res.hdr.flags |= SYNC_FLAG_CHANNEL_SHUTDOWN; - goto respond; + + /* don't respond, just drop; senders of SYNC_COM_CHANNEL_CLOSE + * never wait for a response. */ + goto done; } if (com.recv_len != (sizeof(com.hdr) + sizeof(SALVSYNC_command_hdr))) { @@ -479,6 +482,8 @@ SALVSYNC_com(osi_socket fd) respond: SYNC_putRes(&salvsync_server_state, fd, &res); + + done: if (res.hdr.flags & SYNC_FLAG_CHANNEL_SHUTDOWN) { SALVSYNC_Drop(fd); }