Date: Thu, 18 Sep 2014 20:03:37 +0300 From: Andriy Gapon <avg@FreeBSD.org> To: Will Andrews <will@FreeBSD.org>, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <541B1069.1030704@FreeBSD.org> In-Reply-To: <201409181655.s8IGtgft042984@svn.freebsd.org> References: <201409181655.s8IGtgft042984@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 18/09/2014 19:55, Will Andrews wrote: > Author: will > Date: Thu Sep 18 16:55:41 2014 > New Revision: 271788 > URL: http://svnweb.freebsd.org/changeset/base/271788 > > Log: > Enable ZFS debug flags to be modified via vfs.zfs.debug_flags. > > This is primarily only of interest to ZFS developers, but it makes it > easier to get additional debugging. > > Submitted by: gibbs > MFC after: 1 month > Sponsored by: Spectra Logic > MFSpectraBSD: 517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs) zfs_flags was already accessible via debug.zfs_flags sysctl and tunable. That should probably be removed now? > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:53:44 2014 (r271787) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Sep 18 16:55:41 2014 (r271788) > @@ -259,6 +259,33 @@ SYSCTL_DECL(_vfs_zfs); > SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0, > "Try to recover from otherwise-fatal errors."); > > +static int > +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS) > +{ > + int err, val; > + > + val = zfs_flags; > + err = sysctl_handle_int(oidp, &val, 0, req); > + if (err != 0 || req->newptr == NULL) > + return (err); > + > + /* > + * ZFS_DEBUG_MODIFY must be enabled prior to boot so all > + * arc buffers in the system have the necessary additional > + * checksum data. However, it is safe to disable at any > + * time. > + */ > + if (!(zfs_flags & ZFS_DEBUG_MODIFY)) > + val &= ~ZFS_DEBUG_MODIFY; > + zfs_flags = val; > + > + return (0); > +} > +TUNABLE_INT("vfs.zfs.debug_flags", &zfs_flags); > +SYSCTL_PROC(_vfs_zfs, OID_AUTO, debug_flags, > + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), > + sysctl_vfs_zfs_debug_flags, "IU", "Debug flags for ZFS testing."); > + > /* > * If destroy encounters an EIO while reading metadata (e.g. indirect > * blocks), space referenced by the missing metadata can not be freed. > -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?541B1069.1030704>
