]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
salvager: Do not abort on large volume IDs
authorAndrew Deason <adeason@sinenomine.net>
Tue, 21 Feb 2012 21:28:08 +0000 (15:28 -0600)
committerDerrick Brashear <shadow@dementix.org>
Thu, 23 Feb 2012 20:16:34 +0000 (12:16 -0800)
We have already checked that 'vid' is valid; no need to check if it is
negative. Also change vid to be a VolumeId.

This is partially cherry-picked from
0884e9d0fddf2be81abf6468209048331efa8a1e. The commit
4d691ae10903e01db4d6b24a4eb02da536cadf7c is comprised of changes from
both ce5e263b488f8cb85662031ee08eea448dab2d27 and
0884e9d0fddf2be81abf6468209048331efa8a1e, but it missed a few things
from 0884e9d0fddf2be81abf6468209048331efa8a1e. This commit brings in
the rest of the changes from 0884e9d0fddf2be81abf6468209048331efa8a1e.

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

index 0f3d345eba9732fe94400500ccb314a93f2f8e0c..cd33dabbf8b432e2c09d7e4a639b0a22baae27a0 100644 (file)
@@ -184,7 +184,8 @@ handleit(struct cmd_syndesc *as, void *arock)
 {
     struct cmd_item *ti;
     char pname[100], *temp;
-    afs_int32 seenpart = 0, seenvol = 0, vid = 0;
+    afs_int32 seenpart = 0, seenvol = 0;
+    VolumeId vid = 0;
     struct cmdline_rock *rock = (struct cmdline_rock *)arock;
 
 #ifdef AFS_SGI_VNODE_GLUE
index dd5727332a9e3564803340a7bbfa484746c7787f..16eeac2f29555970e648b2d4d7ee920fb64018cd 100644 (file)
@@ -133,7 +133,8 @@ handleit(struct cmd_syndesc *as, void *arock)
 {
     struct cmd_item *ti;
     char pname[100], *temp;
-    afs_int32 seenpart = 0, seenvol = 0, vid = 0;
+    afs_int32 seenpart = 0, seenvol = 0;
+    VolumeId vid = 0;
     ProgramType pt;
 
 #ifdef FAST_RESTART
@@ -384,10 +385,6 @@ handleit(struct cmd_syndesc *as, void *arock)
            SalvageFileSys(partP, 0);
        else {
            /* Salvage individual volume */
-           if (vid <= 0) {
-               Log("salvage: invalid volume id specified; salvage aborted\n");
-               Exit(1);
-           }
            SalvageFileSys(partP, vid);
        }
     }