From owner-svn-src-all@freebsd.org Mon May 9 17:14:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919A6B34758 for ; Mon, 9 May 2016 17:14:54 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21DAA1F99 for ; Mon, 9 May 2016 17:14:54 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id n129so146779430wmn.1 for ; Mon, 09 May 2016 10:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to; bh=wzpI+Kwm431ijlrVq45ZeEPqgtBTwLqFR4UrY6RJr9E=; b=QW4ckz2iZL39TJ2miDt/qSCSGdydUHP+hRH8+9FXNsXnO0ykqx3BMNvR9Cb7jZb7GB KBKMAIlwOQ3Q1YTTH1rS2Aq/aD3Z8sC7ddsZf1LAK56NxIG+mF4CbpOAgmd3F4rrrNmY xWRvODBDjmGaxY+Cnm3HllI1i2B3/lklZwkM9fMy4ZesdUwiTgzqCY98kydSpPgaNUoT t72jdJyzRv+u32qWLqBzqcHSPjO4V5xXbJ4vRnUNPxdyrNboEI+zmVLSxvONAA7CO5jv p2RZYRaSHU3bZMxSBt0qWyKiFzyxFeKbgTuZMeRlidQ+kWht7aN7XHLBGwG7aCVYxZBa csdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to; bh=wzpI+Kwm431ijlrVq45ZeEPqgtBTwLqFR4UrY6RJr9E=; b=MAdID4dHY1W00lksZHcbkj94L7PL3rEmsdxkzrpTsn9+oudkZ7ejOuvQgEvNguFlno adiCm6giCV9oQfZBucE20ldX7hs/sg2kGfRe8cZqgrHElBIpcZbJY0CrXFsFGnwVYLmU Y5r6BC+Zly9rd60eqpa3Od2abh4oSVJVVmjnaeQu5AeNLcUh2EWEUwiOGQQFGZgSJq8H Z/8pCQyp1/rRcjkCtRprtIPztnDpkTRBnkx42HF9gqqot+yTP5wVxWiAU6k7K2ZO+3UG k928RhOFTJ7S/UHOQU61Z8npPSk6WpfKTGr2eJAIXpEN5hxMtAwJzLelRlmNYxanHUJa oqiA== X-Gm-Message-State: AOPr4FXhUE9fkx3HKY44sYOxkAbtHoEr/tjKhJNO9DkOyLnOFzgVqmQBnK67CaPaIO8icWe3 X-Received: by 10.28.13.137 with SMTP id 131mr13062729wmn.52.1462814092749; Mon, 09 May 2016 10:14:52 -0700 (PDT) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id yr1sm32297217wjc.9.2016.05.09.10.14.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2016 10:14:51 -0700 (PDT) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r295707 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/mmc dev/virtio/block geom geom/journal geom/mirror geom/raid geom/raid3 kern To: Alan Somers , Warner Losh References: <201602171716.u1HHG2c2098316@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <405a3410-a0ee-a638-eefe-c1f8980e5624@freebsd.org> Date: Mon, 9 May 2016 18:14:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 09 May 2016 17:14:54 -0000 On 09/05/2016 18:04, Alan Somers wrote: > > > On Wed, Feb 17, 2016 at 10:16 AM, Warner Losh > wrote: > > Author: imp > Date: Wed Feb 17 17:16:02 2016 > New Revision: 295707 > URL: https://svnweb.freebsd.org/changeset/base/295707 > > Log: > Create an API to reset a struct bio (g_reset_bio). This is mandatory > for all struct bio you get back from g_{new,alloc}_bio. Temporary > bios that you create on the stack or elsewhere should use this > before > first use of the bio, and between uses of the bio. At the moment, it > is nothing more than a wrapper around bzero, but that may change in > the future. The wrapper also removes one place where we encode the > size of struct bio in the KBI. > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > head/sys/dev/mmc/mmcsd.c > head/sys/dev/virtio/block/virtio_blk.c > head/sys/geom/geom.h > head/sys/geom/geom_io.c > head/sys/geom/journal/g_journal.c > head/sys/geom/mirror/g_mirror.c > head/sys/geom/raid/g_raid.c > head/sys/geom/raid3/g_raid3.c > head/sys/kern/kern_physio.c > > > smh noticed that while your commit message says that g_reset_bio is > mandatory after g_{new,alloc}_bio, your diff only replaced existing > calls to bzero. You didn't insert g_reset_bio calls after all > g_alloc_bio calls, for example in vdev_geom_io_start. Do you intend > to follow up this change with a g_reset_bio everywhere that > g_alloc_bio is called, or did you mean that g_reset_bio is optional > after all bios returned by g_{new,alloc}_bio? > Yer I was just penning this too: This commit was just referenced in https://reviews.freebsd.org/D6153 It seems rather odd to require all callers to g_{new,alloc}_bio to also call g_reset_bio. I assume this is because uma can return an existing object instead of fresh one hence its not guaranteed to be bzeroed? If so why have the caller responsible, seems petty error prone. A quick look at users of g_alloc_bio it seems like this is something that's not done currently done in all places, even some usages of memset still hanging around, are these cases a bug? If the concept of this was to ensure correctly initialised objects from uma would the callback handers to uma_zcreate not be a better option as that would guarantee things are correct instead of leaving it to the caller? As a side matter, this area really needs some man pages so the its clear to all what is needed and when. Regards Steve