public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dipankar Sarma <dipankar@in.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: maneesh@in.ibm.com, viro@parcelfarce.linux.theplanet.co.uk,
	linux-kernel@vger.kernel.org, mochel@osdl.org
Subject: Re: [PATCH] sysfs_remove_dir Vs dcache_readdir race fix
Date: Thu, 20 Nov 2003 22:10:13 +0530	[thread overview]
Message-ID: <20031120164012.GA1760@in.ibm.com> (raw)
In-Reply-To: <20031120071709.0acf35aa.akpm@osdl.org>

On Thu, Nov 20, 2003 at 07:17:09AM -0800, Andrew Morton wrote:
> Maneesh Soni <maneesh@in.ibm.com> wrote:
> >  cpu 0						cpu 1
> >  dcache_dir_open()
> >  --> adds the cursor dentry
> > 
> >  					sysfs_remove_dir()
> >  					--> list_del_init cursor dentry
> > 
> >  dcache_readdir()
> >  --> loops forever on inititalized cursor dentry.
> > 
> > 
> >  Though all these operations happen under parent's i_sem, but it is dropped 
> >  between ->open() and ->readdir() as both are different calls. 
> > 
> >  I think people will also agree that there is no need for sysfs_remove_dir() 
> >  to modify d_subdirs list.
> 
> Seems to me that the libfs code is fragile.
> 
> What happens if the dentry at filp->f_private_data gets moved to a
> different directory after someone did dcache_dir_open()?  Does the loop
> in dcache_readdir() go infinite again?

I am not sure if it is that bad. AFAICS, private_data points to a dummy
dentry marking the current directory read position, that dentry cannot
be moved to a different directory.

Thanks
Dipankar

  reply	other threads:[~2003-11-20 16:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-20  5:47 [PATCH] sysfs_remove_dir Vs dcache_readdir race fix Maneesh Soni
2003-11-20  5:49 ` viro
2003-11-20  5:56   ` Maneesh Soni
2003-11-20 10:25     ` Maneesh Soni
2003-11-20 15:17       ` Andrew Morton
2003-11-20 16:40         ` Dipankar Sarma [this message]
2003-11-20 18:44         ` viro
2003-11-20 18:43       ` viro

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=20031120164012.GA1760@in.ibm.com \
    --to=dipankar@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    --cc=mochel@osdl.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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