P_OUTPUT,
P_DELIM,
P_NOHEADING,
+ P_NOMAGIC,
} volinfo_parm_t;
/*
static int NeedDirIndex = 0; /**< Large vnode index handle is needed for path lookups. */
static char ColumnDelim[16] = " "; /**< Column delimiter char(s) */
static char PrintHeading = 0; /**< Print column heading */
+static int CheckMagic = 1; /**< Check directory vnode magic when looking up paths */
static unsigned int ModeMask[64];
static FdHandle_t *DirIndexFd = NULL; /**< Current large vnode index handle for path lookups. */
} else {
PrintHeading = 1;
}
+ if (as->parms[P_NOMAGIC].items) {
+ CheckMagic = 0;
+ }
if ((ti = as->parms[P_DELIM].items)) {
strncpy(ColumnDelim, ti->data, 15);
ColumnDelim[15] = '\0';
"Output field delimiter");
cmd_AddParmAtOffset(ts, P_NOHEADING, "-noheading", CMD_FLAG, CMD_OPTIONAL,
"Do not print the heading line");
+ cmd_AddParmAtOffset(ts, P_NOMAGIC, "-ignore-magic", CMD_FLAG, CMD_OPTIONAL,
+ "Skip directory vnode magic checks when looking up paths.");
}
/**
afs_printable_uint32_lu(parent), (long long unsigned)offset);
return -1;
}
- if (pvn->vnodeMagic != LARGEVNODEMAGIC) {
- fprintf(stderr, "%s: GetDirVnode: bad vnode magic\n", progname);
+ if (CheckMagic && (pvn->vnodeMagic != LARGEVNODEMAGIC)) {
+ fprintf(stderr, "%s: GetDirVnode: bad vnode magic for %lu.%lu at offset %llu\n",
+ progname, afs_printable_uint32_lu(V_id(vp)),
+ afs_printable_uint32_lu(parent), (long long unsigned)offset);
return -1;
}
if (!pvn->dataVersion) {
- fprintf(stderr, "%s: GetDirVnode: dv is zero\n", progname);
+ fprintf(stderr, "%s: GetDirVnode: dv is zero for %lu.%lu at offset %llu\n",
+ progname, afs_printable_uint32_lu(V_id(vp)),
+ afs_printable_uint32_lu(parent), (long long unsigned)offset);
return -1;
}
return 0;