From patchwork Mon Feb 1 17:07:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sripathi Kodi X-Patchwork-Id: 76119 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o11H7ic9009304 for ; Mon, 1 Feb 2010 17:08:20 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NbzkO-0006x9-Ki; Mon, 01 Feb 2010 17:07:36 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NbzkO-0006x2-6e for v9fs-developer@lists.sourceforge.net; Mon, 01 Feb 2010 17:07:36 +0000 Received-SPF: pass (sfi-mx-2.v28.ch3.sourceforge.com: domain of in.ibm.com designates 202.81.31.144 as permitted sender) client-ip=202.81.31.144; envelope-from=sripathik@in.ibm.com; helo=e23smtp02.au.ibm.com; Received: from e23smtp02.au.ibm.com ([202.81.31.144]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1Nbzk9-0005T5-J8 for v9fs-developer@lists.sourceforge.net; Mon, 01 Feb 2010 17:07:35 +0000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp02.au.ibm.com (8.14.3/8.13.1) with ESMTP id o11H4CnO014203 for ; Tue, 2 Feb 2010 04:04:12 +1100 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o11H2CDr1220664 for ; Tue, 2 Feb 2010 04:02:12 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o11H7Cg8028446 for ; Tue, 2 Feb 2010 04:07:12 +1100 Received: from localhost ([9.77.201.99]) by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o11H7AhQ028412; Tue, 2 Feb 2010 04:07:11 +1100 Date: Mon, 1 Feb 2010 22:37:07 +0530 From: Sripathi Kodi To: ericvh@gmail.com Message-ID: <20100201223707.1dda3532@in.ibm.com> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.18.6; i686-redhat-linux-gnu) Mime-Version: 1.0 X-Spam-Score: -5.5 (-----) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [202.81.31.144 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1Nbzk9-0005T5-J8 Cc: v9fs-developer@lists.sourceforge.net Subject: [V9fs-developer] [RFC] [PATCH] 9P/Virtio: kernel panic in 'mount' command. X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 01 Feb 2010 17:08:21 +0000 (UTC) diff -uprN a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c --- a/net/9p/trans_virtio.c 2010-02-01 21:21:34.000000000 +0530 +++ b/net/9p/trans_virtio.c 2010-02-01 22:24:25.000000000 +0530 @@ -101,9 +101,11 @@ static void p9_virtio_close(struct p9_cl { struct virtio_chan *chan = client->trans; - mutex_lock(&virtio_9p_lock); - chan->inuse = false; - mutex_unlock(&virtio_9p_lock); + if (chan) { + mutex_lock(&virtio_9p_lock); + chan->inuse = false; + mutex_unlock(&virtio_9p_lock); + } } /** @@ -307,7 +309,7 @@ p9_virtio_create(struct p9_client *clien if (index >= MAX_9P_CHAN) { printk(KERN_ERR "9p: no channels available\n"); - return -ENODEV; + return -EBUSY; } client->trans = (void *)chan;