From owner-svn-src-all@FreeBSD.ORG Wed May 20 23:35:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF285106564A; Wed, 20 May 2009 23:35:00 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B89D38FC14; Wed, 20 May 2009 23:35:00 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4KNZ0BL047801; Wed, 20 May 2009 23:35:00 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4KNZ0ng047789; Wed, 20 May 2009 23:35:00 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905202335.n4KNZ0ng047789@svn.freebsd.org> From: Kip Macy Date: Wed, 20 May 2009 23:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192498 - in stable/7: . cddl cddl/compat/opensolaris/include cddl/compat/opensolaris/misc cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 23:35:01 -0000 Author: kmacy Date: Wed May 20 23:34:59 2009 New Revision: 192498 URL: http://svn.freebsd.org/changeset/base/192498 Log: MFC ZFS version 13. This includes the changes by pjd (see original message below) as well as the following: - the recurring deadlock was fixed by deferring vinactive to a dedicated thread - zfs boot for all pool types now works Submitted by: dfr - kmem now goes up to 512GB so arc is now limited by physmem - the arc now experiences backpressure from the vm (which can be too much - but this allows ZFS to work without any tunables on amd64) - frequently recurring LOR in the ARC fixed - zfs send coredump fix - fixes for various PRs Supported by: Barrett Lyon, BitGravity Revision 185029 - (view) (annotate) - [select for diffs] Modified Mon Nov 17 20:49:29 2008 UTC (6 months ago) by pjd File length: 38244 byte(s) Diff to previous 177698 Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes. This bring huge amount of changes, I'll enumerate only user-visible changes: - Delegated Administration Allows regular users to perform ZFS operations, like file system creation, snapshot creation, etc. - L2ARC Level 2 cache for ZFS - allows to use additional disks for cache. Huge performance improvements mostly for random read of mostly static content. - slog Allow to use additional disks for ZFS Intent Log to speed up operations like fsync(2). - vfs.zfs.super_owner Allows regular users to perform privileged operations on files stored on ZFS file systems owned by him. Very careful with this one. - chflags(2) Not all the flags are supported. This still needs work. - ZFSBoot Support to boot off of ZFS pool. Not finished, AFAIK. Submitted by: dfr - Snapshot properties - New failure modes Before if write requested failed, system paniced. Now one can select from one of three failure modes: Before if write requested failed, system paniced. Now one can select from one of three failure modes: - panic - panic on write error - wait - wait for disk to reappear - continue - serve read requests if possible, block write requests - Refquota, refreservation properties Just quota and reservation properties, but don't count space consumed by children file systems, clones and snapshots. - Sparse volumes ZVOLs that don't reserve space in the pool. - External attributes Compatible with extattr(2). - NFSv4-ACLs Not sure about the status, might not be complete yet. Submitted by: trasz - Creation-time properties - Regression tests for zpool(8) command. Obtained from: OpenSolaris Added: stable/7/cddl/compat/opensolaris/include/libshare.h (contents, props changed) stable/7/cddl/contrib/opensolaris/cmd/zinject/ stable/7/cddl/contrib/opensolaris/cmd/zinject/translate.c stable/7/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/7/cddl/contrib/opensolaris/cmd/zinject/zinject.h stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/7/cddl/usr.bin/zinject/ stable/7/cddl/usr.bin/zinject/Makefile (contents, props changed) stable/7/sys/boot/i386/zfsboot/ stable/7/sys/boot/i386/zfsboot/zfsboot.c (contents, props changed) stable/7/sys/boot/zfs/ stable/7/sys/boot/zfs/zfsimpl.c (contents, props changed) stable/7/sys/cddl/boot/ stable/7/sys/cddl/boot/zfs/ stable/7/sys/cddl/boot/zfs/README (contents, props changed) stable/7/sys/cddl/boot/zfs/fletcher.c (contents, props changed) stable/7/sys/cddl/boot/zfs/lzjb.c (contents, props changed) stable/7/sys/cddl/boot/zfs/sha256.c (contents, props changed) stable/7/sys/cddl/boot/zfs/zfsimpl.h (contents, props changed) stable/7/sys/cddl/boot/zfs/zfssubr.c (contents, props changed) stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/file.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/kidmap.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/pathname.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/refstr.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/sid.h (contents, props changed) stable/7/sys/cddl/compat/opensolaris/sys/sig.h (contents, props changed) stable/7/sys/cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/sparc64/opensolaris_atomic.S stable/7/sys/cddl/contrib/opensolaris/common/unicode/ stable/7/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h stable/7/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg2.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub2.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_fuid.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid2.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_array.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_mem.c stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/acl_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/extdirent.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/idmap.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/ stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep_data.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/zmod/opensolaris_crc32.c Deleted: stable/7/sys/cddl/compat/opensolaris/sys/acl.h stable/7/sys/cddl/contrib/opensolaris/common/atomic/amd64/atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/i386/atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/ia64/atomic.S stable/7/sys/cddl/contrib/opensolaris/common/atomic/sparc64/atomic.S stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_array.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_mem.c stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/zmod/crc32.c Modified: stable/7/UPDATING stable/7/cddl/Makefile.inc stable/7/cddl/compat/opensolaris/include/mnttab.h stable/7/cddl/compat/opensolaris/misc/deviceid.c stable/7/cddl/compat/opensolaris/misc/mnttab.c stable/7/cddl/compat/opensolaris/misc/zmount.c stable/7/cddl/compat/opensolaris/misc/zone.c stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c stable/7/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/7/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c stable/7/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h stable/7/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_iter.c stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_util.c stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_util.h stable/7/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c stable/7/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/7/cddl/contrib/opensolaris/head/assert.h stable/7/cddl/contrib/opensolaris/head/libintl.h stable/7/cddl/contrib/opensolaris/head/synch.h stable/7/cddl/contrib/opensolaris/head/thread.h stable/7/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c stable/7/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.h stable/7/cddl/contrib/opensolaris/lib/libuutil/common/libuutil.h stable/7/cddl/contrib/opensolaris/lib/libuutil/common/libuutil_common.h stable/7/cddl/contrib/opensolaris/lib/libuutil/common/uu_alloc.c stable/7/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c stable/7/cddl/contrib/opensolaris/lib/libuutil/common/uu_dprintf.c stable/7/cddl/contrib/opensolaris/lib/libuutil/common/uu_list.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_graph.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/7/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/7/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/7/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/7/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c stable/7/cddl/contrib/opensolaris/lib/libzpool/common/util.c stable/7/cddl/lib/Makefile stable/7/cddl/lib/libnvpair/Makefile stable/7/cddl/lib/libzfs/Makefile stable/7/cddl/lib/libzpool/Makefile stable/7/cddl/sbin/zpool/Makefile stable/7/cddl/usr.bin/Makefile stable/7/cddl/usr.bin/ztest/Makefile stable/7/cddl/usr.sbin/Makefile stable/7/cddl/usr.sbin/zdb/Makefile stable/7/sys/cddl/compat/opensolaris/kern/opensolaris.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_zone.c stable/7/sys/cddl/compat/opensolaris/rpc/xdr.h stable/7/sys/cddl/compat/opensolaris/sys/atomic.h stable/7/sys/cddl/compat/opensolaris/sys/cpuvar.h stable/7/sys/cddl/compat/opensolaris/sys/cred.h stable/7/sys/cddl/compat/opensolaris/sys/dnlc.h stable/7/sys/cddl/compat/opensolaris/sys/kmem.h stable/7/sys/cddl/compat/opensolaris/sys/lock.h stable/7/sys/cddl/compat/opensolaris/sys/misc.h stable/7/sys/cddl/compat/opensolaris/sys/mntent.h stable/7/sys/cddl/compat/opensolaris/sys/mutex.h stable/7/sys/cddl/compat/opensolaris/sys/param.h stable/7/sys/cddl/compat/opensolaris/sys/policy.h stable/7/sys/cddl/compat/opensolaris/sys/proc.h stable/7/sys/cddl/compat/opensolaris/sys/rwlock.h stable/7/sys/cddl/compat/opensolaris/sys/sunddi.h stable/7/sys/cddl/compat/opensolaris/sys/sysmacros.h stable/7/sys/cddl/compat/opensolaris/sys/time.h stable/7/sys/cddl/compat/opensolaris/sys/types.h stable/7/sys/cddl/compat/opensolaris/sys/uio.h stable/7/sys/cddl/compat/opensolaris/sys/vfs.h stable/7/sys/cddl/compat/opensolaris/sys/vnode.h stable/7/sys/cddl/compat/opensolaris/sys/zone.h stable/7/sys/cddl/contrib/opensolaris/common/acl/acl_common.c stable/7/sys/cddl/contrib/opensolaris/common/acl/acl_common.h stable/7/sys/cddl/contrib/opensolaris/common/avl/avl.c stable/7/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.h stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h stable/7/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bplist.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_prop.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_synctask.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/7/sys/cddl/contrib/opensolaris/uts/common/os/callb.c stable/7/sys/cddl/contrib/opensolaris/uts/common/os/list.c stable/7/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c stable/7/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/byteorder.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/callb.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/cred.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dkio.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dklabel.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/protocol.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fm/util.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/list.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/processor.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/synch.h stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h stable/7/sys/cddl/contrib/opensolaris/uts/common/zmod/zmod.c stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/compat/pecoff/imgact_pecoff.c stable/7/sys/fs/coda/coda_vfsops.c stable/7/sys/fs/msdosfs/msdosfs_vfsops.c stable/7/sys/fs/nullfs/null_vfsops.c stable/7/sys/fs/unionfs/union_vfsops.c stable/7/sys/modules/opensolaris/Makefile stable/7/sys/modules/zfs/Makefile stable/7/sys/ufs/ffs/ffs_snapshot.c stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Wed May 20 23:33:40 2009 (r192497) +++ stable/7/UPDATING Wed May 20 23:34:59 2009 (r192498) @@ -7,7 +7,12 @@ done items, please see the COMMON ITEMS: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. - +20090520 + Update ZFS to version 13. ZFS users will need to re-build + kernel and world. Existing pools will continue to work + without upgrade. If a pool is upgraded it will no longer be + usable by older kernel revs. ZFS send / recv between + pool version 6 and pool version 13 is not supported. 20090504: FreeBSD 7.2-RELEASE Modified: stable/7/cddl/Makefile.inc ============================================================================== --- stable/7/cddl/Makefile.inc Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/Makefile.inc Wed May 20 23:34:59 2009 (r192498) @@ -6,3 +6,5 @@ OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../. IGNORE_PRAGMA= YES CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +CSTD?= gnu89 Added: stable/7/cddl/compat/opensolaris/include/libshare.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/cddl/compat/opensolaris/include/libshare.h Wed May 20 23:34:59 2009 (r192498) @@ -0,0 +1,144 @@ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ Modified: stable/7/cddl/compat/opensolaris/include/mnttab.h ============================================================================== --- stable/7/cddl/compat/opensolaris/include/mnttab.h Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/include/mnttab.h Wed May 20 23:34:59 2009 (r192498) @@ -9,6 +9,8 @@ #define MNTTAB _PATH_DEVNULL #define MNT_LINE_MAX 1024 +#define umount2(p, f) unmount(p, f) + struct mnttab { char *mnt_special; char *mnt_mountp; Modified: stable/7/cddl/compat/opensolaris/misc/deviceid.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/deviceid.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/misc/deviceid.c Wed May 20 23:34:59 2009 (r192498) @@ -94,11 +94,7 @@ int devid_get(int fd, ddi_devid_t *retdevid) { - if (ioctl(fd, DIOCGIDENT, retdevid->devid) == -1) - return (errno); - if (retdevid->devid[0] == '\0') - return (ENOENT); - return (0); + return (ENOENT); } int Modified: stable/7/cddl/compat/opensolaris/misc/mnttab.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/mnttab.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/misc/mnttab.c Wed May 20 23:34:59 2009 (r192498) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static char * mntopt(char **p) Modified: stable/7/cddl/compat/opensolaris/misc/zmount.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/zmount.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/misc/zmount.c Wed May 20 23:34:59 2009 (r192498) @@ -35,9 +35,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include +#include static void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, @@ -86,7 +87,7 @@ zmount(const char *spec, const char *dir assert(optlen > 0); optstr = strdup(optptr); - assert(optptr != NULL); + assert(optstr != NULL); iov = NULL; iovlen = 0; Modified: stable/7/cddl/compat/opensolaris/misc/zone.c ============================================================================== --- stable/7/cddl/compat/opensolaris/misc/zone.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/compat/opensolaris/misc/zone.c Wed May 20 23:34:59 2009 (r192498) @@ -32,7 +32,7 @@ #include #include -int +zoneid_t getzoneid(void) { size_t size; @@ -42,5 +42,5 @@ getzoneid(void) size = sizeof(jailid); if (sysctlbyname("security.jail.jailed", &jailid, &size, NULL, 0) == -1) assert(!"No security.jail.jailed sysctl!"); - return (jailid); + return ((zoneid_t)jailid); } Modified: stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Wed May 20 23:34:59 2009 (r192498) @@ -28,13 +28,18 @@ zdb \- ZFS debugger .fi .SH DESCRIPTION +.sp .LP The \fBzdb\fR command is used by support engineers to diagnose failures and gather statistics. Since the \fBZFS\fR file system is always consistent on disk and is self-repairing, \fBzdb\fR should only be run under the direction by a support engineer. +.sp .LP If no arguments are specified, \fBzdb\fR, performs basic consistency checks on the pool and associated datasets, and report any problems detected. +.sp .LP Any options supported by this command are internal to Sun and subject to change at any time. .SH EXIT STATUS + +.sp .LP The following exit values are returned: .sp @@ -71,6 +76,9 @@ Invalid command line options were specif .RE .SH ATTRIBUTES + +.sp + .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -89,5 +97,6 @@ Interface StabilityUnstable .TE .SH SEE ALSO +.sp .LP \fBzfs\fR(1M), \fBzpool\fR(1M), \fBattributes\fR(5) Modified: stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed May 20 23:33:40 2009 (r192497) +++ stable/7/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed May 20 23:34:59 2009 (r192498) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -51,6 +49,10 @@ #include #include #include +#include +#undef ZFS_MAXNAMELEN +#undef verify +#include const char cmdname[] = "zdb"; uint8_t dump_opt[256]; @@ -62,6 +64,9 @@ uint64_t *zopt_object = NULL; int zopt_objects = 0; int zdb_advance = ADVANCE_PRE; zbookmark_t zdb_noread = { 0, 0, ZB_NO_LEVEL, 0 }; +libzfs_handle_t *g_zfs; +boolean_t zdb_sig_user_data = B_TRUE; +int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -83,12 +88,15 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-udibcsvLU] [-O order] [-B os:obj:level:blkid] " + "Usage: %s [-udibcsvL] [-U cachefile_path] [-O order] " + "[-B os:obj:level:blkid] [-S user:cksumalg] " "dataset [object...]\n" " %s -C [pool]\n" " %s -l dev\n" - " %s -R vdev:offset:size:flags\n", - cmdname, cmdname, cmdname, cmdname); + " %s -R pool:vdev:offset:size:flags\n" + " %s [-p path_to_vdev_dir]\n" + " %s -e pool | GUID | devid ...\n", + cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); (void) fprintf(stderr, " -u uberblock\n"); (void) fprintf(stderr, " -d datasets\n"); @@ -97,16 +105,22 @@ usage(void) (void) fprintf(stderr, " -b block statistics\n"); (void) fprintf(stderr, " -c checksum all data blocks\n"); (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); + (void) fprintf(stderr, " -S : -- " + "dump blkptr signatures\n"); (void) fprintf(stderr, " -v verbose (applies to all others)\n"); (void) fprintf(stderr, " -l dump label contents\n"); (void) fprintf(stderr, " -L live pool (allows some errors)\n"); (void) fprintf(stderr, " -O [!] " "visitation order\n"); - (void) fprintf(stderr, " -U use zpool.cache in /tmp\n"); + (void) fprintf(stderr, " -U cachefile_path -- use alternate " + "cachefile\n"); (void) fprintf(stderr, " -B objset:object:level:blkid -- " "simulate bad block\n"); - (void) fprintf(stderr, " -R read and display block from a" + (void) fprintf(stderr, " -R read and display block from a " "device\n"); + (void) fprintf(stderr, " -e Pool is exported/destroyed/" + "has altroot\n"); + (void) fprintf(stderr, " -p (use with -e)\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -367,6 +381,44 @@ dump_zap(objset_t *os, uint64_t object, zap_cursor_fini(&zc); } +/*ARGSUSED*/ +static void +dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size) +{ + zap_cursor_t zc; + zap_attribute_t attr; + const char *typenames[] = { + /* 0 */ "not specified", + /* 1 */ "FIFO", + /* 2 */ "Character Device", + /* 3 */ "3 (invalid)", + /* 4 */ "Directory", + /* 5 */ "5 (invalid)", + /* 6 */ "Block Device", + /* 7 */ "7 (invalid)", + /* 8 */ "Regular File", + /* 9 */ "9 (invalid)", + /* 10 */ "Symbolic Link", + /* 11 */ "11 (invalid)", + /* 12 */ "Socket", + /* 13 */ "Door", + /* 14 */ "Event Port", + /* 15 */ "15 (invalid)", + }; + + dump_zap_stats(os, object); + (void) printf("\n"); + + for (zap_cursor_init(&zc, os, object); + zap_cursor_retrieve(&zc, &attr) == 0; + zap_cursor_advance(&zc)) { + (void) printf("\t\t%s = %lld (type: %s)\n", + attr.za_name, ZFS_DIRENT_OBJ(attr.za_first_integer), + typenames[ZFS_DIRENT_TYPE(attr.za_first_integer)]); + } + zap_cursor_fini(&zc); +} + static void dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) { @@ -456,10 +508,7 @@ dump_metaslabs(spa_t *spa) for (c = 0; c < rvd->vdev_children; c++) { vd = rvd->vdev_child[c]; - spa_config_enter(spa, RW_READER, FTAG); - (void) printf("\n vdev %llu = %s\n\n", - (u_longlong_t)vd->vdev_id, vdev_description(vd)); - spa_config_exit(spa, FTAG); + (void) printf("\n vdev %llu\n\n", (u_longlong_t)vd->vdev_id); if (dump_opt['d'] <= 5) { (void) printf("\t%10s %10s %5s\n", @@ -477,7 +526,6 @@ static void dump_dtl(vdev_t *vd, int indent) { avl_tree_t *t = &vd->vdev_dtl_map.sm_root; - spa_t *spa = vd->vdev_spa; space_seg_t *ss; vdev_t *pvd; int c; @@ -485,9 +533,10 @@ dump_dtl(vdev_t *vd, int indent) if (indent == 0) (void) printf("\nDirty time logs:\n\n"); - spa_config_enter(spa, RW_READER, FTAG); - (void) printf("\t%*s%s\n", indent, "", vdev_description(vd)); - spa_config_exit(spa, FTAG); + (void) printf("\t%*s%s\n", indent, "", + vd->vdev_path ? vd->vdev_path : + vd->vdev_parent ? vd->vdev_ops->vdev_op_type : + spa_name(vd->vdev_spa)); for (ss = avl_first(t); ss; ss = AVL_NEXT(t, ss)) { /* @@ -670,36 +719,49 @@ dump_dsl_dir(objset_t *os, uint64_t obje { dsl_dir_phys_t *dd = data; time_t crtime; - char used[6], compressed[6], uncompressed[6], quota[6], resv[6]; + char nice[6]; if (dd == NULL) return; - ASSERT(size == sizeof (*dd)); + ASSERT3U(size, >=, sizeof (dsl_dir_phys_t)); crtime = dd->dd_creation_time; - nicenum(dd->dd_used_bytes, used); - nicenum(dd->dd_compressed_bytes, compressed); - nicenum(dd->dd_uncompressed_bytes, uncompressed); - nicenum(dd->dd_quota, quota); - nicenum(dd->dd_reserved, resv); - (void) printf("\t\tcreation_time = %s", ctime(&crtime)); (void) printf("\t\thead_dataset_obj = %llu\n", (u_longlong_t)dd->dd_head_dataset_obj); (void) printf("\t\tparent_dir_obj = %llu\n", (u_longlong_t)dd->dd_parent_obj); - (void) printf("\t\tclone_parent_obj = %llu\n", - (u_longlong_t)dd->dd_clone_parent_obj); + (void) printf("\t\torigin_obj = %llu\n", + (u_longlong_t)dd->dd_origin_obj); (void) printf("\t\tchild_dir_zapobj = %llu\n", (u_longlong_t)dd->dd_child_dir_zapobj); - (void) printf("\t\tused_bytes = %s\n", used); - (void) printf("\t\tcompressed_bytes = %s\n", compressed); - (void) printf("\t\tuncompressed_bytes = %s\n", uncompressed); - (void) printf("\t\tquota = %s\n", quota); - (void) printf("\t\treserved = %s\n", resv); + nicenum(dd->dd_used_bytes, nice); + (void) printf("\t\tused_bytes = %s\n", nice); + nicenum(dd->dd_compressed_bytes, nice); + (void) printf("\t\tcompressed_bytes = %s\n", nice); + nicenum(dd->dd_uncompressed_bytes, nice); + (void) printf("\t\tuncompressed_bytes = %s\n", nice); + nicenum(dd->dd_quota, nice); + (void) printf("\t\tquota = %s\n", nice); + nicenum(dd->dd_reserved, nice); + (void) printf("\t\treserved = %s\n", nice); (void) printf("\t\tprops_zapobj = %llu\n", (u_longlong_t)dd->dd_props_zapobj); + (void) printf("\t\tdeleg_zapobj = %llu\n", + (u_longlong_t)dd->dd_deleg_zapobj); + (void) printf("\t\tflags = %llx\n", + (u_longlong_t)dd->dd_flags); + +#define DO(which) \ + nicenum(dd->dd_used_breakdown[DD_USED_ ## which], nice); \ + (void) printf("\t\tused_breakdown[" #which "] = %s\n", nice) + DO(HEAD); + DO(SNAP); + DO(CHILD); + DO(CHILD_RSRV); + DO(REFRSRV); +#undef DO } /*ARGSUSED*/ @@ -722,7 +784,7 @@ dump_dsl_dataset(objset_t *os, uint64_t nicenum(ds->ds_unique_bytes, unique); sprintf_blkptr(blkbuf, BP_SPRINTF_LEN, &ds->ds_bp); - (void) printf("\t\tdataset_obj = %llu\n", + (void) printf("\t\tdir_obj = %llu\n", (u_longlong_t)ds->ds_dir_obj); (void) printf("\t\tprev_snap_obj = %llu\n", (u_longlong_t)ds->ds_prev_snap_obj); @@ -749,6 +811,10 @@ dump_dsl_dataset(objset_t *os, uint64_t (u_longlong_t)ds->ds_guid); (void) printf("\t\tflags = %llx\n", (u_longlong_t)ds->ds_flags); + (void) printf("\t\tnext_clones_obj = %llu\n", + (u_longlong_t)ds->ds_next_clones_obj); + (void) printf("\t\tprops_obj = %llu\n", + (u_longlong_t)ds->ds_props_obj); (void) printf("\t\tbp = %s\n", blkbuf); } @@ -765,9 +831,11 @@ dump_bplist(objset_t *mos, uint64_t obje if (dump_opt['d'] < 3) return; + mutex_init(&bpl.bpl_lock, NULL, MUTEX_DEFAULT, NULL); VERIFY(0 == bplist_open(&bpl, mos, object)); if (bplist_empty(&bpl)) { bplist_close(&bpl); + mutex_destroy(&bpl.bpl_lock); return; } @@ -785,6 +853,7 @@ dump_bplist(objset_t *mos, uint64_t obje if (dump_opt['d'] < 5) { bplist_close(&bpl); + mutex_destroy(&bpl.bpl_lock); return; } @@ -800,6 +869,65 @@ dump_bplist(objset_t *mos, uint64_t obje } bplist_close(&bpl); + mutex_destroy(&bpl.bpl_lock); +} + +static avl_tree_t idx_tree; +static avl_tree_t domain_tree; +static boolean_t fuid_table_loaded; + +static void +fuid_table_destroy() +{ + if (fuid_table_loaded) { + zfs_fuid_table_destroy(&idx_tree, &domain_tree); + fuid_table_loaded = B_FALSE; + } +} + +/* + * print uid or gid information. + * For normal POSIX id just the id is printed in decimal format. + * For CIFS files with FUID the fuid is printed in hex followed by + * the doman-rid string. + */ +static void +print_idstr(uint64_t id, const char *id_type) +{ + if (FUID_INDEX(id)) { + char *domain; + + domain = zfs_fuid_idx_domain(&idx_tree, FUID_INDEX(id)); + (void) printf("\t%s %llx [%s-%d]\n", id_type, + (u_longlong_t)id, domain, (int)FUID_RID(id)); + } else { + (void) printf("\t%s %llu\n", id_type, (u_longlong_t)id); + } + +} + +static void +dump_uidgid(objset_t *os, znode_phys_t *zp) +{ + uint32_t uid_idx, gid_idx; + + uid_idx = FUID_INDEX(zp->zp_uid); + gid_idx = FUID_INDEX(zp->zp_gid); + + /* Load domain table, if not already loaded */ + if (!fuid_table_loaded && (uid_idx || gid_idx)) { + uint64_t fuid_obj; + + /* first find the fuid object. It lives in the master node */ + VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES, + 8, 1, &fuid_obj) == 0); + (void) zfs_fuid_table_load(os, fuid_obj, + &idx_tree, &domain_tree); + fuid_table_loaded = B_TRUE; + } + + print_idstr(zp->zp_uid, "uid"); + print_idstr(zp->zp_gid, "gid"); } /*ARGSUSED*/ @@ -830,6 +958,7 @@ dump_znode(objset_t *os, uint64_t object z_ctime = (time_t)zp->zp_ctime[0]; (void) printf("\tpath %s\n", path); + dump_uidgid(os, zp); (void) printf("\tatime %s", ctime(&z_atime)); (void) printf("\tmtime %s", ctime(&z_mtime)); (void) printf("\tctime %s", ctime(&z_ctime)); @@ -874,9 +1003,9 @@ static object_viewer_t *object_viewer[DM dump_zap, /* DSL props */ dump_dsl_dataset, /* DSL dataset */ dump_znode, /* ZFS znode */ - dump_acl, /* ZFS ACL */ + dump_acl, /* ZFS V0 ACL */ dump_uint8, /* ZFS plain file */ - dump_zap, /* ZFS directory */ + dump_zpldir, /* ZFS directory */ dump_zap, /* ZFS master node */ dump_zap, /* ZFS delete queue */ dump_uint8, /* zvol object */ @@ -888,6 +1017,13 @@ static object_viewer_t *object_viewer[DM dump_uint8, /* SPA history */ dump_uint64, /* SPA history offsets */ dump_zap, /* Pool properties */ + dump_zap, /* DSL permissions */ + dump_acl, /* ZFS ACL */ + dump_uint8, /* ZFS SYSACL */ + dump_none, /* FUID nvlist */ + dump_packed_nvlist, /* FUID nvlist size */ + dump_zap, /* DSL dataset next clones */ + dump_zap, /* DSL scrub queue */ }; static void @@ -930,13 +1066,15 @@ dump_object(objset_t *os, uint64_t objec aux[0] = '\0'; - if (doi.doi_checksum != ZIO_CHECKSUM_INHERIT || verbosity >= 6) + if (doi.doi_checksum != ZIO_CHECKSUM_INHERIT || verbosity >= 6) { (void) snprintf(aux + strlen(aux), sizeof (aux), " (K=%s)", zio_checksum_table[doi.doi_checksum].ci_name); + } - if (doi.doi_compress != ZIO_COMPRESS_INHERIT || verbosity >= 6) + if (doi.doi_compress != ZIO_COMPRESS_INHERIT || verbosity >= 6) { (void) snprintf(aux + strlen(aux), sizeof (aux), " (Z=%s)", zio_compress_table[doi.doi_compress].ci_name); + } (void) printf("%10lld %3u %5s %5s %5s %5s %s%s\n", (u_longlong_t)object, doi.doi_indirection, iblk, dblk, lsize, @@ -972,13 +1110,13 @@ dump_object(objset_t *os, uint64_t objec } for (;;) { - error = dnode_next_offset(dn, B_FALSE, &start, minlvl, - blkfill, 0); + error = dnode_next_offset(dn, + 0, &start, minlvl, blkfill, 0); if (error) break; end = start; - error = dnode_next_offset(dn, B_TRUE, &end, minlvl, - blkfill, 0); + error = dnode_next_offset(dn, + DNODE_FIND_HOLE, &end, minlvl, blkfill, 0); nicenum(end - start, segsize); (void) printf("\t\tsegment [%016llx, %016llx)" " size %5s\n", (u_longlong_t)start, @@ -996,7 +1134,6 @@ dump_object(objset_t *os, uint64_t objec static char *objset_types[DMU_OST_NUMTYPES] = { "NONE", "META", "ZPL", "ZVOL", "OTHER", "ANY" }; -/*ARGSUSED*/ static void dump_dir(objset_t *os) { @@ -1019,8 +1156,8 @@ dump_dir(objset_t *os) if (dds.dds_type == DMU_OST_META) { dds.dds_creation_txg = TXG_INITIAL; usedobjs = os->os->os_rootbp->blk_fill; - refdbytes = - os->os->os_spa->spa_dsl_pool->dp_mos_dir->dd_used_bytes; + refdbytes = os->os->os_spa->spa_dsl_pool-> + dp_mos_dir->dd_phys->dd_used_bytes; } else { dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch); } @@ -1054,6 +1191,9 @@ dump_dir(objset_t *os) if (verbosity < 2) return; + if (os->os->os_rootbp->blk_birth == 0) + return; + if (zopt_objects != 0) { for (i = 0; i < zopt_objects; i++) dump_object(os, zopt_object[i], verbosity, @@ -1115,6 +1255,52 @@ dump_config(const char *pool) } static void +dump_cachefile(const char *cachefile) +{ + int fd; + struct stat64 statbuf; + char *buf; + nvlist_t *config; + + if ((fd = open64(cachefile, O_RDONLY)) < 0) { + (void) printf("cannot open '%s': %s\n", cachefile, + strerror(errno)); + exit(1); + } + + if (fstat64(fd, &statbuf) != 0) { + (void) printf("failed to stat '%s': %s\n", cachefile, + strerror(errno)); + exit(1); + } + + if ((buf = malloc(statbuf.st_size)) == NULL) { + (void) fprintf(stderr, "failed to allocate %llu bytes\n", + (u_longlong_t)statbuf.st_size); + exit(1); + } + + if (read(fd, buf, statbuf.st_size) != statbuf.st_size) { + (void) fprintf(stderr, "failed to read %llu bytes\n", + (u_longlong_t)statbuf.st_size); + exit(1); + } + + (void) close(fd); + + if (nvlist_unpack(buf, statbuf.st_size, &config, 0) != 0) { + (void) fprintf(stderr, "failed to unpack nvlist\n"); + exit(1); + } + + free(buf); + + dump_nvlist(config, 0); + + nvlist_free(config); +} + +static void dump_label(const char *dev) { int fd; @@ -1178,170 +1364,84 @@ dump_one_dir(char *dsname, void *arg) objset_t *os; error = dmu_objset_open(dsname, DMU_OST_ANY, - DS_MODE_STANDARD | DS_MODE_READONLY, &os); + DS_MODE_USER | DS_MODE_READONLY, &os); if (error) { (void) printf("Could not open %s\n", dsname); return (0); } dump_dir(os); dmu_objset_close(os); + fuid_table_destroy(); return (0); } static void -zdb_space_map_load(spa_t *spa) +zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) { - vdev_t *rvd = spa->spa_root_vdev; - vdev_t *vd; - int c, m, error; + vdev_t *vd = sm->sm_ppd; - for (c = 0; c < rvd->vdev_children; c++) { - vd = rvd->vdev_child[c]; - for (m = 0; m < vd->vdev_ms_count; m++) { - metaslab_t *msp = vd->vdev_ms[m]; - mutex_enter(&msp->ms_lock); - error = space_map_load(&msp->ms_allocmap[0], NULL, - SM_ALLOC, &msp->ms_smo, spa->spa_meta_objset); - mutex_exit(&msp->ms_lock); - if (error) - fatal("%s bad space map #%d, error %d", - spa->spa_name, c, error); - } - } + (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", + (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -static int -zdb_space_map_claim(spa_t *spa, blkptr_t *bp, zbookmark_t *zb) +/* ARGSUSED */ +static void +zdb_space_map_load(space_map_t *sm) { - dva_t *dva = bp->blk_dva; - vdev_t *vd; - metaslab_t *msp; - space_map_t *allocmap, *freemap; - int error; - int d; - blkptr_t blk = *bp; - - for (d = 0; d < BP_GET_NDVAS(bp); d++) { - uint64_t vdev = DVA_GET_VDEV(&dva[d]); - uint64_t offset = DVA_GET_OFFSET(&dva[d]); - uint64_t size = DVA_GET_ASIZE(&dva[d]); - - if ((vd = vdev_lookup_top(spa, vdev)) == NULL) - return (ENXIO); - - if ((offset >> vd->vdev_ms_shift) >= vd->vdev_ms_count) - return (ENXIO); - - msp = vd->vdev_ms[offset >> vd->vdev_ms_shift]; - allocmap = &msp->ms_allocmap[0]; - freemap = &msp->ms_freemap[0]; - - /* Prepare our copy of the bp in case we need to read GBHs */ - if (DVA_GET_GANG(&dva[d])) { - size = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); - DVA_SET_ASIZE(&blk.blk_dva[d], size); - DVA_SET_GANG(&blk.blk_dva[d], 0); - } - - mutex_enter(&msp->ms_lock); - if (space_map_contains(freemap, offset, size)) { - mutex_exit(&msp->ms_lock); - return (EAGAIN); /* allocated more than once */ - } - - if (!space_map_contains(allocmap, offset, size)) { - mutex_exit(&msp->ms_lock); - return (ESTALE); /* not allocated at all */ - } - - space_map_remove(allocmap, offset, size); - space_map_add(freemap, offset, size); - - mutex_exit(&msp->ms_lock); - } - - if (BP_IS_GANG(bp)) { - zio_gbh_phys_t gbh; - int g; - - /* LINTED - compile time assert */ - ASSERT(sizeof (zio_gbh_phys_t) == SPA_GANGBLOCKSIZE); - - BP_SET_CHECKSUM(&blk, ZIO_CHECKSUM_GANG_HEADER); - BP_SET_PSIZE(&blk, SPA_GANGBLOCKSIZE); - BP_SET_LSIZE(&blk, SPA_GANGBLOCKSIZE); - BP_SET_COMPRESS(&blk, ZIO_COMPRESS_OFF); - error = zio_wait(zio_read(NULL, spa, &blk, &gbh, - SPA_GANGBLOCKSIZE, NULL, NULL, ZIO_PRIORITY_SYNC_READ, - ZIO_FLAG_CANFAIL | ZIO_FLAG_CONFIG_HELD, zb)); - if (error) - return (error); - if (BP_SHOULD_BYTESWAP(&blk)) - byteswap_uint64_array(&gbh, SPA_GANGBLOCKSIZE); - for (g = 0; g < SPA_GBH_NBLKPTRS; g++) { - if (BP_IS_HOLE(&gbh.zg_blkptr[g])) - break; - error = zdb_space_map_claim(spa, &gbh.zg_blkptr[g], zb); - if (error) - return (error); - } - } - - return (0); } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_space_map_unload(space_map_t *sm) { - metaslab_t *msp; - - /* LINTED */ - msp = (metaslab_t *)((char *)sm - offsetof(metaslab_t, ms_allocmap[0])); + space_map_vacate(sm, zdb_leak, sm); +} - (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", - (u_longlong_t)msp->ms_group->mg_vd->vdev_id, - (u_longlong_t)start, - (u_longlong_t)size); +/* ARGSUSED */ +static void +zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) +{ } +static space_map_ops_t zdb_space_map_ops = { + zdb_space_map_load, + zdb_space_map_unload, + NULL, /* alloc */ + zdb_space_map_claim, + NULL /* free */ +}; + static void -zdb_space_map_unload(spa_t *spa) +zdb_leak_init(spa_t *spa) { vdev_t *rvd = spa->spa_root_vdev; - vdev_t *vd; - int c, m; - for (c = 0; c < rvd->vdev_children; c++) { - vd = rvd->vdev_child[c]; - for (m = 0; m < vd->vdev_ms_count; m++) { + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *vd = rvd->vdev_child[c]; + for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_vacate(&msp->ms_allocmap[0], zdb_leak, - &msp->ms_allocmap[0]); - space_map_unload(&msp->ms_allocmap[0]); - space_map_vacate(&msp->ms_freemap[0], NULL, NULL); + VERIFY(space_map_load(&msp->ms_map, &zdb_space_map_ops, + SM_ALLOC, &msp->ms_smo, spa->spa_meta_objset) == 0); + msp->ms_map.sm_ppd = vd; mutex_exit(&msp->ms_lock); } } } static void -zdb_refresh_ubsync(spa_t *spa) +zdb_leak_fini(spa_t *spa) { - uberblock_t ub = { 0 }; vdev_t *rvd = spa->spa_root_vdev; - zio_t *zio; - - /* - * Reload the uberblock. - */ - zio = zio_root(spa, NULL, NULL, - ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE); - vdev_uberblock_load(zio, rvd, &ub); - (void) zio_wait(zio); - if (ub.ub_txg != 0) - spa->spa_ubsync = ub; + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *vd = rvd->vdev_child[c]; + for (int m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *msp = vd->vdev_ms[m]; + mutex_enter(&msp->ms_lock); + space_map_unload(&msp->ms_map); + mutex_exit(&msp->ms_lock); + } + } } /* @@ -1371,9 +1471,7 @@ typedef struct zdb_cb { static void zdb_count_block(spa_t *spa, zdb_cb_t *zcb, blkptr_t *bp, int type) { - int i, error; - - for (i = 0; i < 4; i++) { + for (int i = 0; i < 4; i++) { int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL; int t = (i & 1) ? type : DMU_OT_TOTAL; zdb_blkstats_t *zb = &zcb->zcb_type[l][t]; @@ -1384,21 +1482,34 @@ zdb_count_block(spa_t *spa, zdb_cb_t *zc zb->zb_count++; } - if (dump_opt['L']) - return; + if (dump_opt['S']) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***