From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH linux-2.6.18-xen] fix xenbus_transaction_start() hang caused by double xenbus_transaction_end() Date: Thu, 19 May 2011 10:49:18 +0100 Message-ID: <4DD503BE0200007800042136@vpn.id2.novell.com> References: <4DCBB551.7000002@redhat.com> <4DCD04A402000078000412DD@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4DCD04A402000078000412DD@vpn.id2.novell.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Laszlo Ersek Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 13.05.11 at 10:15, "Jan Beulich" wrote: >>>> On 12.05.11 at 12:24, Laszlo Ersek wrote: >> fix xenbus_transaction_start() hang caused by double xenbus_transaction_= end() >>=20 >> vbd_resize() up_read()'s xs_state.suspend_mutex twice in a row via = double >> xenbus_transaction_end() calls. The next down_read() in >> xenbus_transaction_start() (at eg. the next resize attempt) hangs. >>=20 >> See RHBZ#618317. >>=20 >> Thanks for considering. >>=20 >> Signed-off-by: Laszlo Ersek >=20 > Acked-by: Jan Beulich >=20 > (I wonder how this ever passed any testing.) Hmm, I think if this really wasn't *that* bad. In particular I'm finding that neither pv-ops nor the legacy tree has anything called suspend_mutex in drivers/xen/xenbus/xenbus_xs.c, nor is there any other mutex being up_read()-ed in transaction_end(). What got corrupted by the double call was transaction_count, which would have had a negative effect at the next transaction_suspend() (but not at any subsequent transaction_start()). Jan > The same would be needed for pv-ops too afaics. >=20 > Jan >=20 >> --- >> drivers/xen/blkback/vbd.c | 1 + >> 1 file changed, 1 insertion(+) >>=20 >> diff --git a/drivers/xen/blkback/vbd.c b/drivers/xen/blkback/vbd.c >> --- a/drivers/xen/blkback/vbd.c >> +++ b/drivers/xen/blkback/vbd.c >> @@ -156,6 +156,7 @@ >> goto again; >> if (err) >> printk(KERN_WARNING "Error ending transaction"); >> + return; >> abort: >> xenbus_transaction_end(xbt, 1); >> } >>=20 >>=20 >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com=20 >> http://lists.xensource.com/xen-devel=20 >=20 >=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com=20 > http://lists.xensource.com/xen-devel=20