From aecc87faf7f0975197abaf0b015a6b74a2ba95a1 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Tue, 30 Oct 2012 10:41:12 -0400 Subject: [PATCH] fix stale volume info from vos examine (non-dafs) A volume examine on a non-dafs volume server/fileserver can show old information, including old volume update time, for up to about 20 minutes. The non-dafs volume server reads the volume information from the volume headers, which are updated by the fileserver only periodically to avoid excessive i/o. Before dafs, when the volume server performed a volume examine, the volume server would send a fssync command to the fileserver with the request FSYNC_NEEDVOLUME and mode V_READONLY. The fileserver writes the current memory contents to disk on this fssync command. The volume server would then attach the volume, reading the current volume data. The dafs volume/fileserver avoids this extra i/o by using a new set of fssync commands to retrieve the volume information from the fileserver. However, the non-dafs volume server does not use the new fssync commands and reads the volume headers from disk. Revert the volume attachment processing for the non-dafs volume server to request the volume with the V_READONLY mode. This causes the fileserver to update the volume headers, allowing the volume server to read the up to date volume header data. Sadly, this adds another dafs ifdef to the already twisty maze of passages that all look alike. This changes the volserver to use the V_READONLY attachment mode only for the case of getting a single volume, as that what was done in 1.4.x. Reviewed-on: http://gerrit.openafs.org/8327 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit bcb077a00fb575e7beb92739646054ea67ca0b79) Change-Id: I5b5982efd5ee3aea13515add83b71d424dbd3a60 Reviewed-on: http://gerrit.openafs.org/8459 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Andrew Deason --- src/volser/volprocs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 8d1ad7fb63..d8b965c64c 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -2228,8 +2228,15 @@ GetVolInfo(afs_uint32 partId, /* Get volume from volserver */ if (mode == VOL_INFO_LIST_MULTIPLE) tv = VAttachVolumeByName(&error, pname, volname, V_PEEK); - else - tv = VAttachVolumeByName_retry(&error, pname, volname, V_PEEK); + else { +#ifdef AFS_DEMAND_ATTACH_FS + int mode = V_PEEK; +#else + int mode = V_READONLY; /* informs the fileserver to update the volume headers. */ +#endif + tv = VAttachVolumeByName_retry(&error, pname, volname, mode); + } + if (error) { Log("1 Volser: GetVolInfo: Could not attach volume %u (%s:%s) error=%d\n", volumeId, pname, volname, error);