Bug 160283 - [zfs] [patch] 'zfs list' does abort in make_dataset_handle
Summary: [zfs] [patch] 'zfs list' does abort in make_dataset_handle
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2011-08-29 17:00 UTC by Stef Walter
Modified: 2017-12-31 22:32 UTC (History)
0 users

See Also:

file.diff (1.68 KB, patch)
2011-08-29 17:00 UTC, Stef Walter
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stef Walter 2011-08-29 17:00:24 UTC
After a failed zfs receive, zfs list now aborts in make_dataset_handle()
in libzfs.so.2.

# zfs list
Abort trap: 6 (core dumped)

The backtrace is:

#0  0x0000000800fe63cc in kill () from /lib/libc.so.7
#1  0x0000000800fe51cb in abort () from /lib/libc.so.7
#2  0x000000080067400f in make_dataset_handle () from /lib/libzfs.so.2
#3  0x0000000800674346 in zfs_iter_filesystems () from /lib/libzfs.so.2
#4  0x000000000040ad51 in ?? ()
#5  0x0000000800674354 in zfs_iter_filesystems () from /lib/libzfs.so.2
#6  0x000000000040ad51 in ?? ()
#7  0x000000080066642c in zfs_iter_root () from /lib/libzfs.so.2

Running on:

FreeBSD m1.bay.npubs.net 8.2-RELEASE-p2 FreeBSD 8.2-RELEASE-p2 #0: Wed Jul 27 12:49:35 UTC 2011     sam@m1.bay.npubs.net:/usr/obj/usr/src/sys/RACK1  amd64

'zfs scrub' did not fix the error. 'zfs create' and other zfs commands
still work, as do access to the various zfs file systems on this system.

After poking around a bit, I find that in make_dataset_handle()
zhp->zfs_dmustats.dds_type is equal to 0 (and this is the cause of the
abort). Additionally zhp->zfs_dmustats.dds_inconsistent is not TRUE.

Fix: Will attach a patch which fixes the issue.

Patch attached with submission follows:
How-To-Repeat: Hard to repeat. Depends on zfs recv aborting at specific times in specific circumstances, possibly involving prior reboots.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-08-30 03:09:45 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:38 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped