From 012e9e26b8877b00c32c401d1ee7b980dc494849 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 30 Nov 2011 14:36:06 -0600 Subject: [PATCH] DAFS: Do not transition to ERROR on trivial errors attach2 can result in many different errors; some indicate that the volume is in an inconsistent state, but many others just indicate that the volume cannot be attached for benign reasons (such as VNOVOL if the volume doesn't exist, or VOFFLINE if the volume is being used by a volume utility). Currently, for DAFS, attach2 transitions the relevant volume to the VOL_STATE_ERROR state for almost all errors encountered, even the benign ones. Instead, skip the error state transition for error handling paths that do not reflect a "broken" volume. Reviewed-on: http://gerrit.openafs.org/6164 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 5fc2365f5dff7f193781093ecb886b4c7391d5a3) Change-Id: Ia3d732781c98fcda4db7b41cd744db860781594f Reviewed-on: http://gerrit.openafs.org/6320 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/vol/volume.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vol/volume.c b/src/vol/volume.c index ed91b0f75..2415fb907 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -3116,7 +3116,8 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, if (*ec == VNOVOL) { /* if the volume doesn't exist, skip straight to 'error' so we don't * request a salvage */ - goto unlocked_error; + VOL_LOCK; + goto error_notbroken; } if (!*ec) { @@ -3210,7 +3211,8 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, goto locked_error; } else if (*ec) { /* volume operation in progress */ - goto unlocked_error; + VOL_LOCK; + goto error_notbroken; } #else /* AFS_DEMAND_ATTACH_FS */ if (*ec) { @@ -3409,7 +3411,10 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, return vp; +#ifndef AFS_DEMAND_ATTACH_FS unlocked_error: +#endif + VOL_LOCK; locked_error: #ifdef AFS_DEMAND_ATTACH_FS @@ -3422,6 +3427,7 @@ locked_error: VReleaseVolumeHandles_r(vp); } + error_notbroken: #ifdef AFS_DEMAND_ATTACH_FS VCheckSalvage(vp); if (forcefree) { -- 2.39.5