From owner-freebsd-stable@FreeBSD.ORG Mon Nov 25 04:31:26 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A077589C; Mon, 25 Nov 2013 04:31:26 +0000 (UTC) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C352293D; Mon, 25 Nov 2013 04:31:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id rAP4UQqj028170; Mon, 25 Nov 2013 15:30:26 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Mon, 25 Nov 2013 15:30:26 +1100 (EST) From: Ian Smith To: "Alexander V. Chernikov" Subject: Re: ipfw table add problem In-Reply-To: <529259DE.2040701@FreeBSD.org> Message-ID: <20131125152238.S78756@sola.nimnet.asn.au> References: <52911993.8010108@ipfw.ru> <529259DE.2040701@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: freebsd-ipfw , Luigi Rizzo , freebsd-stable , =?UTF-8?B?w5Z6a2FuIEtJUklL?= X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2013 04:31:26 -0000 On Sun, 24 Nov 2013 23:56:14 +0400, Alexander V. Chernikov wrote: > On 24.11.2013 19:43, Özkan KIRIK wrote: > > Hi, > > > > I tested patch. This patch solves, ipfw table 1 add 4899 > Ok. So I'll commit this fix soon. > > > > But, ipfw table 1 add 10.2.3.01 works incorrectly. > > output is below. > > # ./ipfw table 1 flush > > # ./ipfw table 1 add 10.2.3.01 > inet_pton() does not recognize this as valid IPv4 address, so it is > treated as usigned unteger key. It looks like this behavior is mentioned > in STANDARDS section. > > # ./ipfw table 1 list > > 0.0.0.10/32 0 I'm wondering if "so don't do that" is really sufficient to deal with this? If it's not recognised as a valid address, shouldn't it fail to add anything, with a complaint? I don't see how a string containing dots can be seen as a valid unsigned integer? cheers, Ian From owner-freebsd-stable@FreeBSD.ORG Mon Nov 25 08:32:18 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 753918F5; Mon, 25 Nov 2013 08:32:18 +0000 (UTC) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 3E33F24D7; Mon, 25 Nov 2013 08:32:18 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 5E106411; Mon, 25 Nov 2013 09:25:45 +0100 (CET) Date: Mon, 25 Nov 2013 09:32:23 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Subject: Re: Hast locking up under 9.2 Message-ID: <20131125083223.GE1398@garage.freebsd.pl> References: <20131121203711.GA3736@gmail.com> <20131123215950.GA17292@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WplhKdTI2c8ulnbP" Content-Disposition: inline In-Reply-To: <20131123215950.GA17292@gmail.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-stable@freebsd.org, Pete French X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2013 08:32:18 -0000 --WplhKdTI2c8ulnbP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 23, 2013 at 11:59:51PM +0200, Mikolaj Golub wrote: > On Fri, Nov 22, 2013 at 11:18:29AM +0000, Pete French wrote: >=20 > > "Assertion failed: (!hio->hio_done), function write_complete, file > > /usr/src/sbin/hastd/primary.c, line 1130." >=20 > It looks like write_complete usage (which should be called once per > write request) for memsync is racy. >=20 > Consider the following scenario: >=20 > 1) remote_recv_thread: memsync ack received, refcount -> 2; > 2) local_send_thread: local write completed, refcount -> 1, entering > write_complete() > 3) remote_recv_thread: memsync fin received, refcount -> 0, move hio > to done queue, ggate_send_thread gets the hio, checks for > !hio->hio_done and (if loca_send_thread is still in > write_complete()) entering write_complete() I don't see how is that possible. The write_complete() function is called only when hio_countdown goes from 2 to 1 and because this is atomic operation it can only happen in one thread. Can you elaborate on how calling write_complete() concurrently for the same request is possible? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --WplhKdTI2c8ulnbP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlKTCxcACgkQForvXbEpPzQmGwCaA5vKu0Jo/FrPxvpYDZiJydk2 JTQAoNctwZNEWmgY14oXdxJBrinujWVN =Qm2c -----END PGP SIGNATURE----- --WplhKdTI2c8ulnbP--