X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fvol%2Fvg_cache.c;h=5a53a2f578c16d7fbcae80089b6e8f1fd0bed914;hp=307b358b25cf5ff07cd92a28a593e8c0cb4f3e3d;hb=65b55bcc26f69f25c67518f672b34be73f3be370;hpb=2f2c2ce62aa17ecac3651d64c1168af926f7458b diff --git a/src/vol/vg_cache.c b/src/vol/vg_cache.c index 307b358..5a53a2f 100644 --- a/src/vol/vg_cache.c +++ b/src/vol/vg_cache.c @@ -869,32 +869,37 @@ _VVGC_entry_purge_r(struct DiskPartition64 * dp, VolumeId parent, VolumeId child) { int code = 0, res; - VVGCache_entry_t * parent_ent, * child_ent; + VVGCache_entry_t * child_ent; VVGCache_hash_entry_t * child_hent; - /* check mappings for each volid */ - res = _VVGC_lookup(dp, parent, &parent_ent, NULL); - if (res) { - code = res; - goto done; - } res = _VVGC_lookup(dp, child, &child_ent, &child_hent); if (res) { code = res; goto done; } - /* if the mappings don't match, we have a serious error */ - if (parent_ent != child_ent) { - ViceLog(0, ("VVGCache_entry_del: trying to delete vol %lu from VG %lu, " - "but vol %lu points to VGC entry %"AFS_PTR_FMT" and VG %lu " - "points to VGC entry %"AFS_PTR_FMT"\n", - afs_printable_uint32_lu(child), - afs_printable_uint32_lu(parent), - afs_printable_uint32_lu(child), - child_ent, afs_printable_uint32_lu(parent), parent_ent)); - code = -1; - goto done; + if (parent != 0) { + VVGCache_entry_t * parent_ent; + + res = _VVGC_lookup(dp, parent, &parent_ent, NULL); + if (res) { + code = res; + goto done; + } + + /* if the mappings don't match, we have a serious error */ + if (parent_ent != child_ent) { + ViceLog(0, + ("VVGCache_entry_del: trying to delete vol %lu from VG %lu, " + "but vol %lu points to VGC entry %" AFS_PTR_FMT + " and VG %lu " "points to VGC entry %" AFS_PTR_FMT "\n", + afs_printable_uint32_lu(child), + afs_printable_uint32_lu(parent), + afs_printable_uint32_lu(child), child_ent, + afs_printable_uint32_lu(parent), parent_ent)); + code = -1; + goto done; + } } code = _VVGC_hash_entry_del(child_hent);