From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: davem@davemloft.net, ericvh@gmail.com, jvrao@linux.vnet.ibm.com,
rusty@rustcorp.com.au, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, davej@redhat.com
Subject: Re: [PATCH] 9p: disconnect channel when PCI device is removed
Date: Mon, 16 Apr 2012 16:29:01 +0530 [thread overview]
Message-ID: <87ehrodjt6.fsf@skywalker.in.ibm.com> (raw)
In-Reply-To: <CA+1xoqfgA6DJL7ztMOdfLZedV6YwzZPUfbovFykdSSZy0Aio6w@mail.gmail.com>
Sasha Levin <levinsasha928@gmail.com> writes:
> On Sun, Apr 15, 2012 at 2:27 PM, Aneesh Kumar K.V
> <aneesh.kumar@linux.vnet.ibm.com> wrote:
>> Sasha Levin <levinsasha928@gmail.com> writes:
>>
>>> When a virtio_9p pci device is being removed, we should close down any
>>> active channels and free up resources, we're not supposed to BUG() if there's
>>> still an open channel since it's a valid case when removing the PCI device.
>>>
>>> Otherwise, removing the PCI device with an open channel would cause the
>>> following BUG():
>>>
>> ...
>>
>>> diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
>>> index 3d43206..5af18d1 100644
>>> --- a/net/9p/trans_virtio.c
>>> +++ b/net/9p/trans_virtio.c
>>> @@ -615,7 +615,8 @@ static void p9_virtio_remove(struct virtio_device *vdev)
>>> {
>>> struct virtio_chan *chan = vdev->priv;
>>>
>>> - BUG_ON(chan->inuse);
>>> + if (chan->inuse)
>>> + p9_virtio_close(chan->client);
>>> vdev->config->del_vqs(vdev);
>>>
>>> mutex_lock(&virtio_9p_lock);
>>
>> But an umount should have resulted in p9_virtio_close ? How are you
>> removing the device ? Are you removing the device with file system
>> mounted ?. In that case may be we should return EBUSY ?
>
> I signal the underlying PCI device to remove (echo 1 >
> /sys/devices/pci0000\:00/[...]/remove), we can't really prevent that
> thing so we must clean up ourselves.
What does that mean for the mounted file system ? What would happen to
the pending fs operations in that case ?
-aneesh
next prev parent reply other threads:[~2012-04-16 10:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 21:48 [PATCH] 9p: disconnect channel when PCI device is removed Sasha Levin
2012-04-15 12:27 ` Aneesh Kumar K.V
2012-04-16 4:35 ` Sasha Levin
2012-04-16 10:59 ` Aneesh Kumar K.V [this message]
2012-04-28 8:55 ` Sasha Levin
2012-04-28 18:16 ` Aneesh Kumar K.V
2012-04-29 3:21 ` Sasha Levin
2012-05-07 3:15 ` Rusty Russell
2012-05-07 7:14 ` Aneesh Kumar K.V
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ehrodjt6.fsf@skywalker.in.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=ericvh@gmail.com \
--cc=jvrao@linux.vnet.ibm.com \
--cc=levinsasha928@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox