From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:37:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 919B46E3; Thu, 18 Sep 2014 17:37:34 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 54593A9E; Thu, 18 Sep 2014 17:37:33 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id E362120E7088D; Thu, 18 Sep 2014 17:37:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 4148620E70886; Thu, 18 Sep 2014 17:37:29 +0000 (UTC) Message-ID: <5783417ED470465B9C816FCA02B3690D@multiplay.co.uk> From: "Steven Hartland" To: "Will Andrews" , , , References: <201409181655.s8IGtgft042984@svn.freebsd.org> Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Thu, 18 Sep 2014 18:37:28 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 18 Sep 2014 17:37:34 -0000 You don't need a seperate TUNABLE_INT declations any more since the excellent SYSCTL refactor. Regards Steve ----- Original Message ----- From: "Will Andrews" To: ; ; Sent: Thursday, September 18, 2014 5:55 PM Subject: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs > 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) > > 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. > >