From 81e7a5adf93a6b5eec104ca4bde429cf6cb0548a Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 7 Dec 2010 21:26:59 -0500 Subject: [PATCH] DAFS: fix forceDAFS support in salvager we need to get the shared partition lock for the per-volume forceDAFS case Change-Id: I7be91420bb0df5963e789c932e5c469fe02ec108 Reviewed-on: http://gerrit.openafs.org/3487 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/vol/salvager.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/vol/salvager.c b/src/vol/salvager.c index 78ad8212d..883ef0760 100644 --- a/src/vol/salvager.c +++ b/src/vol/salvager.c @@ -294,10 +294,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 @@ -325,6 +321,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 -- 2.39.5