From 46f7bbb19dbb697e626a20363ff23ad2fe0ee4c0 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 9 Sep 2009 09:22:02 -0500 Subject: [PATCH] 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 --- src/vol/fssync-server.c | 7 ++++++- src/vol/salvsync-server.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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); } -- 2.39.5