From owner-svn-src-head@freebsd.org Wed Nov 7 15:57:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6005112939C for ; Wed, 7 Nov 2018 15:57:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7F76E5FA for ; Wed, 7 Nov 2018 15:57:47 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1541606258; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Vp6tSPi1gAP+ehxpXRn8TVuYf0Zg9TRscGQf1r8tPpne21xRsO5+FCVx57bjXaZQLuNiG+NZR/Rsd P5Z1DFqa2XOkFdErw459y4IyoWdwr4WPm7QeiGpJ4aUu3oy/So20QFqDB0CWNluWkl54wLxcLc0nib qXopoSb0UQcq8vCUqbQcvIvHdpsqb0l15RiHcZR7ORNn26yZgUvoV1MI9m/IxVJVwqw5evTKlms+nc CzIxD+qADqpeItiA+6Tuj/sFANtFFE6Nwac/eu6WMdxWmNiOseJuty00bQTLn4+JnDmbT9sgILWOgD kzYcrIxTDnF5TOq6EkdY93XsshJowcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=XnDOjznJWXyyWG2eWbFLLBWJJnOWgKzkpBgES7Qgb5I=; b=lZWdY4HWhx2NGtG/jxA4bNVpWHL2LoxA1u5v8xJgxBR6LLSJdcWyKTwnhgf30KSaqfm6KHiq4nfan zI75TKSmFdGNZCvNPkmvfZmzaEHeOTvBV2snpCMzACTH+7KPvWUENq4EQxES5W0DdwpMNaQ8AjSXxd q3eMUMoeaSrFJfpB+ApXr+ouZ5+d782LZ8DgIwIY9X/h8WFw8vqMcHaNBtv1tEXtp03VkfLSh80wj9 4Z/w+oCzGNPqUKnmJeaEkWQNqLdE0fc0dz8OBvq9fJfpgQurCk1EQJya5FgaxZGI9A5ZqYmKL1Bdar nC77oqFr8cMAGSPStkOEgiFJ37ZBVwg== ARC-Authentication-Results: i=1; outbound1.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=XnDOjznJWXyyWG2eWbFLLBWJJnOWgKzkpBgES7Qgb5I=; b=tkYY0S2OqvIhjqwbNqgePdHtVGBH8Cp9pIpwOir37o30jlsUCglQAoVdpODRsVVd7q5byATIOpXoX mNTKuO8SXHC5kUONjd9zEVFMSEiz+/F4zclzFp7D1+FimTtyrg8QuwcTTIUXI4KbjiZjZw9oEGPs3n 3xvyALZ1LtBpPgJQlC4pSFzsfoUaELQY4bXC84eOO+YJ3iH8tvDFp21ZSjB9ijgydkZm2lrBcYjcbu ILNfeM9dMJ/qopsNYb33ZmHryG3RizDaH5ecXsNDsGIbHLdqf/z7CA85/f+UkJBZpiGFj582JwE1bN M/WaALNCq7JB5UR0bwSuBGtiTeung3A== X-MHO-RoutePath: aGlwcGll X-MHO-User: d3f06d1c-e2a5-11e8-9048-075f73944867 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id d3f06d1c-e2a5-11e8-9048-075f73944867; Wed, 07 Nov 2018 15:57:34 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wA7FvSOg083525; Wed, 7 Nov 2018 08:57:28 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1541606248.52306.42.camel@freebsd.org> Subject: Re: svn commit: r340187 - head/sys/geom From: Ian Lepore To: rgrimes@freebsd.org, Maxim Sobolev Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Pawel Jakub Dawidek Date: Wed, 07 Nov 2018 08:57:28 -0700 In-Reply-To: <201811070017.wA70HbO2098370@pdx.rh.CN85.dnsmgr.net> References: <201811070017.wA70HbO2098370@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E7F76E5FA X-Spamd-Result: default: False [-103.90 / 200.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; HAS_XOIP(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; DKIM_TRACE(0.00)[outbound.mailhop.org:+]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.15)[asn: 16509(-0.67), country: US(-0.09)]; ARC_ALLOW(-1.00)[i=1]; ASN(0.00)[asn:16509, ipnet:52.58.0.0/15, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[60.211.177.67.zen.spamhaus.org : 127.0.0.10]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[outbound.mailhop.org]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[202.109.58.52.list.dnswl.org : 127.0.20.0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 15:57:48 -0000 On Tue, 2018-11-06 at 16:17 -0800, Rodney W. Grimes wrote: > > > > Rodney, this was actually my original intention, however then I noticed in > > the GEOM code there is at least one case when BIO_FLUSH request is being > > generated internally with bio_offset == mediasize and bio_lenth == 0, so I > > thought there might be some need to allow such requests through. But I'd > > happily go with the stricter rule if it does no harm. I simply don't know > > enough about the intended use and the logic behind zero-length transfers to > > make that call. > I am not sure enough on if mediasize is 0 based or not, > if it is then the error case should be fixed, and the > code you show below should also be fixed as it is > technically making a request beyond the end of device. > > I am also murky on why we are even doing a 0 size > operation and end of device, is that to validate > we can access all the media?  If so then this wrong > code and wrong error return should be fixed as it > is off by 1. > > > > > > > -Max > > > > int > > g_io_flush(struct g_consumer *cp) > > { > > ... > >         bp = g_alloc_bio(); > >         bp->bio_cmd = BIO_FLUSH; > > ... > >         bp->bio_offset = cp->provider->mediasize; > The above should have a - 1 on it. > Unless offset > mediasize is specifically a signal to downstream code in some way about how the flush is to be performed. Nearly identical code to create a BIO_FLUSH bio appears in ufs softdeps and in zfs. Before starting to arbitrarily change code that has worked since 2006, it might be a good idea to track down why these values are set the way they are. Unfortunately, there is no clue in the commit logs, but maybe the author (pjd@, cc'd) can englighten us. -- Ian