From owner-svn-src-all@FreeBSD.ORG Thu Sep 18 17:05:56 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 5E2646CB for ; Thu, 18 Sep 2014 17:05:56 +0000 (UTC) Received: from mail-qg0-f43.google.com (mail-qg0-f43.google.com [209.85.192.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D05E79A for ; Thu, 18 Sep 2014 17:05:55 +0000 (UTC) Received: by mail-qg0-f43.google.com with SMTP id a108so1485083qge.30 for ; Thu, 18 Sep 2014 10:05:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=4RjKTjIz/WFgqfllyFvR272HXSYFx2sVFBYlqgzqqy4=; b=EHVGnd3KcFfvvyEDOhRcw2gXnYlewitf6s6q5A3wACQ9SYLmVbQlCNWRkwYZxyZ2M4 aeJj+wgIDhtXyt/RdmCMVa7Agfxz6m6EuufuK5RlZYFBkCsWG6ShC/coKVLogI3dk6/Q YLwKHAl5nivItUNF3SnSsOPZ8ssglsc6KHsKYqGCIJKbrnz53VijJKeWtKdlG1XtJFEu E0XCmNUOQcMbSgoW26mq+xDUIbV+rSzaNQQ6I1tFTcfmv6oEm6p8gRnssQduFxubG/Qp eJL98vmLRE8aZ4PwiVin1LRrwzcQYvBS/Rpc/JT04HGJw7lGZ1R8XWdXUbsW7N5eQxk2 Wuxg== X-Gm-Message-State: ALoCoQlGFcG7vLy4BHXcyuV1UcPV10WmqKoUtQ8Co/BKq0oVpFrPgvscwgwrMuo2KKEIbRdayNlg MIME-Version: 1.0 X-Received: by 10.224.165.134 with SMTP id i6mr11337250qay.4.1411059949523; Thu, 18 Sep 2014 10:05:49 -0700 (PDT) Received: by 10.140.16.183 with HTTP; Thu, 18 Sep 2014 10:05:49 -0700 (PDT) In-Reply-To: <541B1069.1030704@FreeBSD.org> References: <201409181655.s8IGtgft042984@svn.freebsd.org> <541B1069.1030704@FreeBSD.org> Date: Thu, 18 Sep 2014 11:05:49 -0600 Message-ID: Subject: Re: svn commit: r271788 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Will Andrews To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@FreeBSD.org" 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:05:56 -0000 Which one is more idiomatic? Sorry, I never noticed that one. Thanks, --Will. On Thu, Sep 18, 2014 at 11:03 AM, Andriy Gapon wrote: > 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