mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: viro@parcelfarce.linux.theplanet.co.uk
To: Maneesh Soni <maneesh@in.ibm.com>
Cc: Greg KH <greg@kroah.com>, Patrick Mochel <mochel@osdl.org>,
	Christian Borntraeger <CBORNTRA@de.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Dipankar Sarma <dipankar@in.ibm.com>
Subject: Re: [RFC 2/5] sysfs-dir.patch
Date: Wed, 12 Nov 2003 14:39:24 +0000	[thread overview]
Message-ID: <20031112143923.GF24159@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20031112122529.GF14580@in.ibm.com>

On Wed, Nov 12, 2003 at 05:55:29PM +0530, Maneesh Soni wrote:
> @@ -110,10 +231,15 @@ void sysfs_remove_subdir(struct dentry *
>  void sysfs_remove_dir(struct kobject * kobj)
>  {
>  	struct list_head * node;
> -	struct dentry * dentry = dget(kobj->dentry);
> +	struct dentry * dentry = kobj->s_dirent->s_dentry;
> +	struct sysfs_dirent * parent_sd;
>  
>  	if (!dentry)
> -		return;
> +		goto exit;
> +		
> +	spin_lock(&dcache_lock);
> +	dentry = dget_locked(dentry);
> +	spin_unlock(&dcache_lock);

Racy.  Directory might've been looked up just as you've decided that it
had no dentry.

>  void sysfs_rename_dir(struct kobject * kobj, const char *new_name)
> @@ -162,14 +292,170 @@ void sysfs_rename_dir(struct kobject * k
>  	if (!kobj->parent)
>  		return;
>  
> -	parent = kobj->parent->dentry;
> +	parent = kobj->parent->s_dirent->s_dentry;
> +	if (parent) {

Ditto.

Look, the *only* benefit of ramfs as a backing store for sysfs was that we
could easily get locking right.  You want second tree - you get to fight
for coherency.

  parent reply	other threads:[~2003-11-12 14:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-12 12:23 [RFC 0/5] Backing Store for sysfs (Overhauled) Maneesh Soni
2003-11-12 12:25 ` [RFC 1/5] sysfs-backing-store.patch Maneesh Soni
2003-11-12 12:25   ` [RFC 2/5] sysfs-dir.patch Maneesh Soni
2003-11-12 12:25     ` [RFC 3/5] sysfs-file.patch Maneesh Soni
2003-11-12 12:26       ` [RFC 4/5] sysfs-attr_group.patch Maneesh Soni
2003-11-12 12:26         ` [RFC 5/5] sysfs-symlink.patch Maneesh Soni
2003-11-12 14:39     ` viro [this message]
2003-11-12 16:00 ` [RFC 0/5] Backing Store for sysfs (Overhauled) Greg KH
2003-11-12 16:27   ` Dipankar Sarma
2003-11-12 16:39     ` Greg KH
2003-11-13 19:34 ` Patrick Mochel
2003-11-13 19:55   ` Dipankar Sarma

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=20031112143923.GF24159@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=CBORNTRA@de.ibm.com \
    --cc=dipankar@in.ibm.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    --cc=mochel@osdl.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

Powered by JetHome