xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: Joe Jin <joe.jin@oracle.com>
Cc: Keir Fraser <keir.fraser@citrix.com>,
	xen-devel@lists.xensource.com, deepak.patel@oracle.com,
	greg.marsden@oracle.com
Subject: Re: [PATCH] Fix blkback/blktap sysfs read bug.
Date: Tue, 19 Jan 2010 12:06:32 +0000	[thread overview]
Message-ID: <4B55AE58020000780002AB39@vpn.id2.novell.com> (raw)
In-Reply-To: <20100119113224.GA21348@joejin-pc.cn.oracle.com>

>>> "Joe Jin" <joe.jin@oracle.com> 19.01.10 12:32 >>>
>On 2010-01-19 10:25, Jan Beulich wrote:
>> >>> "Joe Jin" <joe.jin@oracle.com> 19.01.10 10:52 >>>
>> >At backend driver blkback and blktap, when checking statistics information,
>> >at the time vbd device remove, kernel will crash.
>> >
>> >Below patch will fix it, please review and apply.
>> 
>> This isn't a complete fix if I follow your analysis: There's still a race
>> between blk{back,tap}_remove() freeing be->blkif/be and the sysfs
>> code. dev->dev.driver_data (and possibly be->blkif) must be cleared
>> before freeing it (them).
>> 
>
>Thanks for you point.
>Anyway, I think need to add some check at VBD_SHOW even cleared 
>dev->dev.driver_data before free it, sysfs->fops() have been 
>initialized when call open(), and later when read the file, call
>trace will fall VBD_SHOW defined function(s), so it should crashed.

I think I understand what you're saying. But then there's only one
solution - avoid freeing those two data structures from the .remove
handler.

>The checks may look like below?

Checking dev to be non-NULL is certainly pointless in any case.

But wait - how did you see the crash you're trying to fix occur in the
first place? blkback_remove() calls xenvbd_sysfs_delif(), so the sysfs
entries are gone by the time driver_data gets freed.

Jan

  reply	other threads:[~2010-01-19 12:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-19  9:52 [PATCH] Fix blkback/blktap sysfs read bug Joe Jin
2010-01-19 10:25 ` Jan Beulich
2010-01-19 11:32   ` Joe Jin
2010-01-19 12:06     ` Jan Beulich [this message]
2010-01-19 14:13       ` Joe Jin
2010-01-19 16:20         ` Jan Beulich
2010-01-20  2:06           ` Joe Jin
2010-01-20  7:46             ` Jan Beulich
2010-01-20 10:51               ` Joe Jin
2010-01-20 11:06                 ` Jan Beulich
2010-01-20 11:45                   ` Joe Jin
2010-01-20 20:25                     ` Keir Fraser
2010-01-21  2:16                     ` Daniel Stodden
2010-01-21  3:13                       ` Joe Jin
2010-01-21  7:26                         ` Daniel Stodden
2010-01-21  7:49                           ` Joe Jin
2010-01-21 18:01                             ` Daniel Stodden

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=4B55AE58020000780002AB39@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=deepak.patel@oracle.com \
    --cc=greg.marsden@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=keir.fraser@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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;
as well as URLs for NNTP newsgroup(s).