]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DAFS: fix forceDAFS support in salvager
authorDerrick Brashear <shadow@dementia.org>
Wed, 8 Dec 2010 02:26:59 +0000 (21:26 -0500)
committerDerrick Brashear <shadow@dementia.org>
Thu, 24 Mar 2011 16:22:59 +0000 (09:22 -0700)
we need to get the shared partition lock for the per-volume
forceDAFS case

Reviewed-on: http://gerrit.openafs.org/3487
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 81e7a5adf93a6b5eec104ca4bde429cf6cb0548a)

Change-Id: Ie7c6a43d25c621a3faca2a6564fbc06f9af87880
Reviewed-on: http://gerrit.openafs.org/4278
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/salvager.c

index da5c168a43933637be4a37037488840f21066245..6439b0fb3a2006d7249707ed57a93cbdb8d44380 100644 (file)
@@ -285,10 +285,6 @@ handleit(struct cmd_syndesc *as, void *arock)
     }
 #endif
 
-    if (get_salvage_lock) {
-       ObtainSalvageLock();
-    }
-
     /* Note:  if seenvol we initialize this as a standard volume utility:  this has the
      * implication that the file server may be running; negotations have to be made with
      * the file server in this case to take the read write volume and associated read-only
@@ -316,6 +312,14 @@ handleit(struct cmd_syndesc *as, void *arock)
        Exit(1);
     }
 
+    /* defer lock until we init volume package */
+    if (get_salvage_lock) {
+       if (seenvol && AskDAFS()) /* support forceDAFS */
+           ObtainSharedSalvageLock();
+       else
+           ObtainSalvageLock();
+    }
+
     /*
      * Ok to defer this as Exit will clean up and no real work is done
      * init'ing volume package