From owner-svn-src-all@freebsd.org Wed Nov 7 16:59:27 2018 Return-Path: Delivered-To: svn-src-all@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 D6DAC112A4FD; Wed, 7 Nov 2018 16:59:26 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501F770CC8; Wed, 7 Nov 2018 16:59:26 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wA7GxOa6001892; Wed, 7 Nov 2018 08:59:24 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wA7GxO8Q001891; Wed, 7 Nov 2018 08:59:24 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811071659.wA7GxO8Q001891@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340187 - head/sys/geom In-Reply-To: To: Maxim Sobolev Date: Wed, 7 Nov 2018 08:59:24 -0800 (PST) CC: rgrimes@freebsd.org, Ian Lepore , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Pawel Jakub Dawidek Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 501F770CC8 X-Spamd-Result: default: False [2.10 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.60)[0.596,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.14)[0.137,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.49)[0.495,0]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 07 Nov 2018 16:59:27 -0000 > Reverted, sorry. Turns out that i/o into last_sector+1 is handled > differently. I'll probably have to use different strategy to properly fail > out-of-bound ioctl(DIOCGDELETE) or otherwise indicate its result to the > userland app. To my defense, this patch has been out for 3 weeks on > freebsd-geom, and I got 0 responses. Well you have some now, so lets try to sort this out and at least document what the funny "access one byte past end with zero size I/O" is about. A good stratergy when you get no response on a phabricator review is to poke about it on @current or @arch requesting feedback. The phabricator notificaiton to potential reviewers is very low. freebsd-geom is also probably a pretty short list. > -Max > > On Wed, Nov 7, 2018 at 8:06 AM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > 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. > > > > Could very well be, should be documented some place though. > > > > > 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. > > > > I agree with that take on the situation, and it is why I asked > > for a revert and investigation, rather than trying to solve > > why we suddenly fail some regression tests. > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > -- Rod Grimes rgrimes@freebsd.org