#ifdef AFS_OSF_ENV
#include <ufs/inode.h>
#else /* AFS_OSF_ENV */
-#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV)
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_ARM_DARWIN_ENV)
#include <sys/inode.h>
#endif
#endif
Exit(SALSRV_EXIT_VOLGROUP_LINK);
}
- salvinfo->volumeSummaryp = malloc(VOL_VG_MAX_VOLS * sizeof(struct VolumeSummary));
+ salvinfo->volumeSummaryp = calloc(VOL_VG_MAX_VOLS, sizeof(struct VolumeSummary));
osi_Assert(salvinfo->volumeSummaryp != NULL);
salvinfo->nVolumes = 0;
nvols = VOL_VG_MAX_VOLS;
}
- salvinfo->volumeSummaryp = malloc(nvols * sizeof(struct VolumeSummary));
+ salvinfo->volumeSummaryp = calloc(nvols, sizeof(struct VolumeSummary));
osi_Assert(salvinfo->volumeSummaryp != NULL);
params.singleVolumeNumber = singleVolumeNumber;
Log("No header file for volume %u; %screating %s\n",
isp->volumeId, (Testing ? "it would have been " : ""),
path);
- isp->volSummary = (struct VolumeSummary *)
- malloc(sizeof(struct VolumeSummary));
+ isp->volSummary = calloc(1, sizeof(struct VolumeSummary));
isp->volSummary->fileName = ToString(headerName);
writefunc = VCreateVolumeDiskHeader;
} else {
if (vcp->magic != vnode->vnodeMagic) {
/* bad magic #, probably partially created vnode */
+ if (check) {
+ Log("Partially allocated vnode %d: bad magic (is %lx should be %lx)\n",
+ vnodeNumber, afs_printable_uint32_lu(vnode->vnodeMagic),
+ afs_printable_uint32_lu(vcp->magic));
+ memset(vnode, 0, vcp->diskSize);
+ err = -1;
+ goto zooks;
+ }
Log("Partially allocated vnode %d deleted.\n",
vnodeNumber);
memset(vnode, 0, vcp->diskSize);
break;
} else if (i < 2) {
/* try it again */
- Log("AskOnline: request for fileserver to take volume offline failed; trying again...\n");
+ Log("AskOnline: request for fileserver to put volume online failed; trying again...\n");
FSYNC_clientFinis();
FSYNC_clientInit();
}