vol-fssync-ack-before-breaking-callbacks-20020612
authorDerrick Brashear <shadow@dementia.org>
Wed, 12 Jun 2002 23:07:08 +0000 (23:07 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 12 Jun 2002 23:07:08 +0000 (23:07 +0000)
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

src/vol/fssync.c

index a4756e3..0a2fb38 100644 (file)
@@ -321,7 +321,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;
@@ -507,6 +507,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);
@@ -519,6 +525,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
@@ -533,11 +545,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)