All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Alex Chiang <achiang@hp.com>
Cc: greg@kroah.com, cornelia.huck@de.ibm.com,
	stern@rowland.harvard.edu, kay.sievers@vrfy.org,
	rusty@rustcorp.com.au, ebiederm@xmission.com,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/3] sysfs: care-free suicide for sysfs files
Date: Thu, 26 Mar 2009 14:24:27 +0900	[thread overview]
Message-ID: <49CB118B.7080501@gmail.com> (raw)
In-Reply-To: <20090325041702.15921.59355.stgit@bob.kio>

Hello,

Alex Chiang wrote:
> diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
> index 39320a5..993edd1 100644
> --- a/fs/sysfs/dir.c
> +++ b/fs/sysfs/dir.c
> @@ -583,6 +583,8 @@ void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt)
>  		sd->s_sibling = NULL;
>  
>  		sysfs_drop_dentry(sd);
> +		if (sysfs_type(sd) == SYSFS_KOBJ_ATTR)
> +			sysfs_file_check_suicide(sd);
>  		sysfs_deactivate(sd);
>  		sysfs_put(sd);
>  	}

I think there's a hole here.  sysfs_file_check_suicide() should be
done inside sysfs_deactivate() such that commiting suicide atomically
deactivates the sd.  This will solve the multiple writes to suicide
node problem nicely.

Thanks.

-- 
tejun

  reply	other threads:[~2009-03-26  5:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25  4:16 [RFC PATCH 0/3] sysfs: allow suicide Alex Chiang
2009-03-25  4:16 ` [RFC PATCH 1/3] sysfs: make the sysfs_addrm_cxt->removed list FIFO Alex Chiang
2009-03-25  4:16 ` [RFC PATCH 2/3] sysfs: add blocking notifier to prohibit module unload Alex Chiang
2009-03-25  4:17 ` [RFC PATCH 3/3] sysfs: care-free suicide for sysfs files Alex Chiang
2009-03-26  5:24   ` Tejun Heo [this message]
2009-03-25  5:54 ` [RFC PATCH 0/3] sysfs: allow suicide Eric W. Biederman
2009-03-25 22:54   ` Alex Chiang
2009-03-26  0:42     ` Eric W. Biederman
2009-03-26  1:26       ` Alex Chiang
2009-03-26  2:41         ` Eric W. Biederman
2009-03-26  1:32       ` Tejun Heo
2009-03-26  3:05         ` Eric W. Biederman
2009-03-26  3:36           ` Tejun Heo
2009-03-26 14:21             ` Alan Stern
2009-03-26 14:56               ` Cornelia Huck
2009-03-25 14:45 ` Alan Stern
2009-03-25 23:03   ` Alex Chiang

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=49CB118B.7080501@gmail.com \
    --to=htejun@gmail.com \
    --cc=achiang@hp.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.