Currently SetupVolume panics if it cannot successfully read a
volumeinfo entry from disk. Try to return an error instead, so we
don't panic the machine.
Change-Id: Iad3c2c857f1b736fcf4a142338d9e219bab68969
Reviewed-on: http://gerrit.openafs.org/9094
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
err =
afs_osi_Read(tfile, sizeof(struct fvolume) * j,
&staticFVolume, sizeof(struct fvolume));
- if (err != sizeof(struct fvolume))
- osi_Panic("read volumeinfo2");
osi_UFSClose(tfile);
+ if (err != sizeof(struct fvolume)) {
+ afs_warn("afs_SetupVolume: error %d reading volumeinfo\n",
+ (int)err);
+ /* put tv back on the free list; the data in it is not valid */
+ tv->next = afs_freeVolList;
+ afs_freeVolList = tv;
+ /* staticFVolume contents are not valid */
+ afs_FVIndex = -1;
+ ReleaseWriteLock(&afs_xvolume);
+ return NULL;
+ }
afs_FVIndex = j;
}
tf = &staticFVolume;