]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
libadmin: Catch VL_GetNewVolumeId failures
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 26 Feb 2013 11:59:56 +0000 (11:59 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Jun 2014 16:10:43 +0000 (12:10 -0400)
If ubik_VL_GetVolumeId fails in the vos ProcessEntries routine,
report the failure and give up, rather than continuing with a
0 maxVolid

Caught by coverity (#988417)

Reviewed-on: http://gerrit.openafs.org/9268
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 8192554e36272d5ed21007b4c0e3b6c56511457d)

Change-Id: I004386d62dc9d2955a795c4c5952b573ff203784
Reviewed-on: http://gerrit.openafs.org/11010
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/libadmin/vos/vsprocs.c

index 2dc0c5b11bf546013e1ded9a9ebd8a55a0880bd7..6b016f08d3ee5f884ceff6ef7b3c605f0fa428d5 100644 (file)
@@ -3010,22 +3010,31 @@ ProcessEntries(afs_cell_handle_p cellHandle, struct qHead *myQueue,
        if (maxVolid <= elem.ids[RWVOL]) {
            temp2 = elem.ids[RWVOL] - maxVolid + 1;
            maxVolid = 0;
-           ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
-                                  &maxVolid);
+           vcode = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
+                                          &maxVolid);
+           if (vcode)
+               return vcode;
+
            maxVolid += temp2;
        }
        if (maxVolid <= elem.ids[ROVOL]) {
            temp2 = elem.ids[ROVOL] - maxVolid + 1;
            maxVolid = 0;
-           ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
-                                  &maxVolid);
+           vcode = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
+                                          &maxVolid);
+           if (vcode)
+               return vcode;
+
            maxVolid += temp2;
        }
        if (maxVolid <= elem.ids[BACKVOL]) {
            temp2 = elem.ids[BACKVOL] - maxVolid + 1;
            maxVolid = 0;
-           ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
-                                  &maxVolid);
+           vcode = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
+                                          &maxVolid);
+           if (vcode)
+               return vcode;
+
            maxVolid += temp2;
        }
        aVLDB_GetEntryByID(cellHandle, elem.ids[RWVOL], RWVOL, &entry, &tst);