mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lisa Du <cldu@marvell.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: A race condition between debugfs and seq_file operation
Date: Wed, 10 Jun 2015 06:18:26 +0000	[thread overview]
Message-ID: <cac45ab977954eea86b46f6566b3ee87@SC-EXCH04.marvell.com> (raw)
In-Reply-To: <20150610052023.GA23451@kroah.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2111 bytes --]



> -----Original Message-----
> From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> Sent: 2015年6月10日 13:20
> To: Lisa Du
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: A race condition between debugfs and seq_file operation
> 
> On Wed, Jun 10, 2015 at 05:00:03AM +0000, Lisa Du wrote:
> > > -----Original Message-----
> > > From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> > > Sent: 2015年6月10日 5:12
> > > To: Lisa Du
> > > Cc: linux-kernel@vger.kernel.org
> > > Subject: Re: A race condition between debugfs and seq_file operation
> > >
> > > On Mon, Jun 08, 2015 at 04:28:10AM +0000, Lisa Du wrote:
> > > > Hi, All
> > > > Recently I met one race condition related to debugfs.
> > > >
> > > > Take an example from ion.c in kernel3.14:
> > > > static int ion_debug_client_open(struct inode *inode, struct file
> > > > *file) {
> > > > 	return single_open(file, ion_debug_client_show,
> > > > inode->i_private); }
> > > >
> > > > static const struct file_operations debug_client_fops = {
> > > > 	.open = ion_debug_client_open,
> > > > 	.read = seq_read,
> > > > 	.llseek = seq_lseek,
> > > > 	.release = single_release,
> > > > };
> > > > client->debug_root = debugfs_create_file(client->display_name,
> > > > client->0664,
> > > > 					dev->clients_debug_root,
> > > > 					client, &debug_client_fops);
> > > >
> > > > I find during I read the debugfs node, driver can do
> > > > debugfs_remove_recursive(dentry); Is it expected?
> > >
> > > Yes.  Well, not "expected", but a mess, yes.
> > >
> > > Removing debugfs files are known to have lots of races, this isn't
> > > the only one :(
> > Thanks for the reply!
> > Not sure if there is any plan to resolve such races in the future?
> 
> Yes, I have "plans", but it's on my very long todo list behind lots of
> other things...
> 
> If you want to look into it, please, that would be wonderful.
Ok, I see, thanks!
> 
> thanks,
> 
> greg k-h
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2015-06-10  6:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAG9bXvm70+hE5qsk1UGCzXn3d6FcDs1AJhjM-Homcsu2OmHt6w@mail.gmail.com>
     [not found] ` <CAG9bXv=xFZfuX26OXA+5Go38+JXbq-rwbhcjnyKdTacerRtCvA@mail.gmail.com>
     [not found]   ` <CAG9bXvnTPkD8ZDKNakqzKVuJ+iOETdYj6=R2moTnmdUP=X1YVw@mail.gmail.com>
2015-06-08  4:28     ` Lisa Du
2015-06-09 21:12       ` gregkh
2015-06-10  5:00         ` Lisa Du
2015-06-10  5:20           ` gregkh
2015-06-10  6:18             ` Lisa Du [this message]
2015-06-10 14:00             ` Matthias Schiffer
2015-06-10 14:49               ` gregkh

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=cac45ab977954eea86b46f6566b3ee87@SC-EXCH04.marvell.com \
    --to=cldu@marvell.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®