Bug #3139
zdb dies when it tries to determine path of unlinked file
90%
Description
From Matt Ahrens's original bug report at Delphix:
"zdb -vvv" prints the path of files and directores. However, if a file is on
the delete queue (aka unlinked set), its parent pointer is no longer valid. If
the parent object has been freed and its object number reused for a plain file,
zdb will fail this assertion when it tries to use the ZAP to access a non-ZAP
object:
Assertion failed: (((doi.doi_type) & 0x80) ? ((doi.doi_type) & 0x3f) :
dmu_ot[(doi.doi_type)].ot_byteswap) DMU_BSWAP_ZAP (0x0 0x4), file
../../../uts/common/fs/zfs/zap_micro.c, line 464
A kernel panic could happen if userland passed this deleted object ID to
zfs_ioc_obj_to_path().
The fix is to make zfs_obj_to_path() not try to determine the path if the file
has zero links. zfs_obj_to_pobj() should look up the number of links, and if
it is zero then return EINVAL.
Updated by Eric Schrock over 8 years ago
- Status changed from In Progress to Resolved
changeset: 13820:2ce1147810ed
tag: tip
user: Jeremy Jones <jeremy@delphix.com>
date: Thu Sep 20 08:39:18 2012 -0700
description:
3139 zdb dies when it tries to determine path of unlinked file
Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Approved by: Dan McDonald <danmcd@nexenta.com>