From d994536a11480917d6d5229113c7a4e56c3b17d2 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Fri, 2 Aug 2002 04:11:14 +0000 Subject: [PATCH] STABLE12-vol-fssync-ack-before-breaking-callbacks-20020612 given that we don't bother to do anything to return value, we can ack the fssync op earlier and not tie up the volserver unnecessarily found due to comments from brent.johnson@jpl.nasa.gov (cherry picked from commit d7e3e249cbb4ebe0f1d3be3d02b5b593e576cfa0) --- src/vol/fssync.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/vol/fssync.c b/src/vol/fssync.c index a17d60f54..9acaa284b 100644 --- a/src/vol/fssync.c +++ b/src/vol/fssync.c @@ -317,7 +317,7 @@ static void FSYNC_com(fd) int fd; { byte rc = FSYNC_OK; - int n, i; + int n, i, ack = 1; Error error; struct command command; int leaveonline; @@ -503,6 +503,12 @@ defect #2080 for details. vp->specialStatus = VMOVED; VPutVolume_r(vp); } +#ifdef AFS_NT40_ENV + send(fd, &rc, 1, 0); +#else + write(fd, &rc, 1); +#endif + ack = 0; if (V_BreakVolumeCallbacks) { Log("fssync: volume %u moved to %x; breaking all call backs\n", command.volume, command.reason); @@ -515,6 +521,12 @@ defect #2080 for details. break; case FSYNC_RESTOREVOLUME: /* if the volume is being restored, break all callbacks on it*/ +#ifdef AFS_NT40_ENV + send(fd, &rc, 1, 0); +#else + write(fd, &rc, 1); +#endif + ack = 0; if (V_BreakVolumeCallbacks) { VOL_UNLOCK VATTACH_UNLOCK @@ -529,11 +541,13 @@ defect #2080 for details. } VOL_UNLOCK VATTACH_UNLOCK + if (ack) { #ifdef AFS_NT40_ENV - send(fd, &rc, 1, 0); + send(fd, &rc, 1, 0); #else - write(fd, &rc, 1); + write(fd, &rc, 1); #endif + } } static void FSYNC_Drop(fd) -- 2.39.5