From: Nickolai Zeldovich Date: Wed, 30 Jan 2002 16:16:23 +0000 (+0000) Subject: Avoid deadlocking with afs_ResetVolumeInfo in InstallVolumeInfo and X-Git-Tag: openafs-devel-1_3_0~20 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=cc8f0afbad688fde60468e5811ac18b75f24886a;p=packages%2Fo%2Fopenafs.git Avoid deadlocking with afs_ResetVolumeInfo in InstallVolumeInfo and InstallNVolumeInfo, like we already do in InstallUVolumeInfo. --- diff --git a/src/afs/afs_volume.c b/src/afs/afs_volume.c index 914c27d7e..1a94a1e66 100644 --- a/src/afs/afs_volume.c +++ b/src/afs/afs_volume.c @@ -771,6 +771,15 @@ void InstallVolumeEntry(struct volume *av, struct vldbentry *ve, int acell) cellp = afs_GetCell(acell, 0); + /* This volume, av, is locked. Zero out the serverHosts[] array + * so that if afs_GetServer() decides to replace the server + * struct, we don't deadlock trying to afs_ResetVolumeInfo() + * this volume. + */ + for (j=0; jserverHost[j] = 0; + } + /* Step through the VLDB entry making sure each server listed is there */ for (i=0,j=0; inServers; i++) { if ( ((ve->serverFlags[i] & mask) == 0) || (ve->serverFlags[i] & VLSF_DONTUSE) ) { @@ -838,6 +847,15 @@ void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, int acell) cellp = afs_GetCell(acell, 0); + /* This volume, av, is locked. Zero out the serverHosts[] array + * so that if afs_GetServer() decides to replace the server + * struct, we don't deadlock trying to afs_ResetVolumeInfo() + * this volume. + */ + for (j=0; jserverHost[j] = 0; + } + /* Step through the VLDB entry making sure each server listed is there */ for (i=0,j=0; inServers; i++) { if ( ((ve->serverFlags[i] & mask) == 0) || (ve->serverFlags[i] & VLSF_DONTUSE) ) {