linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Maneesh Soni <maneesh@in.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Clemens Schwaighofer <cs@tequila.co.jp>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Dipankar Sarma <dipankar@in.ibm.com>,
	Chuck Ebbert <cebbert@redhat.com>
Subject: Re: [PATCH 2/2] sysfs: fix race condition around sd->s_dentry, take#2
Date: Sun, 10 Jun 2007 09:18:47 -0700	[thread overview]
Message-ID: <20070610161847.GA12773@kroah.com> (raw)
In-Reply-To: <466A4D8A.1050809@gmail.com>

On Sat, Jun 09, 2007 at 03:49:46PM +0900, Tejun Heo wrote:
> Tejun Heo wrote:
> > Tejun Heo wrote:
> >> Greg KH wrote:
> >>> On Mon, May 21, 2007 at 10:31:01AM +0530, Maneesh Soni wrote:
> >>>> On Thu, May 17, 2007 at 08:16:10PM +0200, Tejun Heo wrote:
> >>>>> Allowing attribute and symlink dentries to be reclaimed means
> >>>>> sd->s_dentry can change dynamically.  However, updates to the field
> >>>>> are unsynchronized leading to race conditions.  This patch adds
> >>>>> sysfs_lock and use it to synchronize updates to sd->s_dentry.
> >>>>>
> >>>>> Due to the locking around ->d_iput, the check in sysfs_drop_dentry()
> >>>>> is complex.  sysfs_lock only protect sd->s_dentry pointer itself.  The
> >>>>> validity of the dentry is protected by dcache_lock, so whether dentry
> >>>>> is alive or not can only be tested while holding both locks.
> >>>>>
> >>>>> This is minimal backport of sysfs_drop_dentry() rewrite in devel
> >>>>> branch.
> >>>>>
> >>>>> DONT APPLY JUST YET
> >>>> Looks ok to me.. I have tested it it but unfortunately I couldn't
> >>>> recreate the race without the patch also. It would be helpful if
> >>>> people actually seeing the race, provide the test results.
> >>>>
> >>>> Greg, please merge this one once we have some test results.
> >>> Can someone just resend it after those test results are in, with the
> >>> proper signed-off-by, so I know it's safe to apply?
> >> I'll resend with S-O-B after someone verifies it fixes the problem.
> > 
> > Have been trying to reproduce the problem on the latest -rc but haven't
> > succeeded yet.  It seems I lost my magic recipe for these races.  Did
> > anyone succeed?
> 
> Alright, overnight test finally hit the race condition.  It takes me
> much longer now but the race condition is definitely still there.  I'll
> verify each proposed patch and send it for 2.6.22 inclusion and if
> they're accepted to -stable.

Ok, thanks for doing this.

greg k-h

  reply	other threads:[~2007-06-10 16:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16  0:24 Oops and Panics in 2.6.21.1, 2.6.20.6 and 2.6.19.2 Clemens Schwaighofer
2007-05-16  1:52 ` Clemens Schwaighofer
2007-05-16  1:53 ` Andrew Morton
2007-05-16  2:02   ` Clemens Schwaighofer
2007-05-16  2:46   ` Clemens Schwaighofer
2007-05-16  3:18     ` Andrew Morton
2007-05-16 11:05   ` Tejun Heo
2007-05-16 15:29     ` Andrew Morton
2007-05-16 15:40       ` Tejun Heo
2007-05-16 16:06         ` Chuck Ebbert
2007-05-16 16:13         ` Andrew Morton
2007-05-16 18:31           ` [PATCH -stable] sysfs: disable reclamation by default Tejun Heo
2007-05-17 12:04             ` Greg KH
2007-05-17 17:39               ` Maneesh Soni
2007-05-17 17:49                 ` Tejun Heo
2007-05-17 17:52                   ` [PATCH 1/2] sysfs: fix condition check in sysfs_drop_dentry() Tejun Heo
2007-05-21  4:35                     ` Maneesh Soni
2007-05-17 17:59                   ` [PATCH 2/2] sysfs: fix race condition around sd->s_dentry Tejun Heo
2007-05-17 18:16                     ` [PATCH 2/2] sysfs: fix race condition around sd->s_dentry, take#2 Tejun Heo
2007-05-21  5:01                       ` Maneesh Soni
2007-05-21 16:02                         ` Eric Sandeen
2007-05-21 16:15                           ` Tejun Heo
2007-05-22 22:38                         ` Greg KH
2007-05-23  8:21                           ` Tejun Heo
2007-06-08 14:35                             ` Tejun Heo
2007-06-09  6:49                               ` Tejun Heo
2007-06-10 16:18                                 ` Greg KH [this message]
2007-05-21  4:39                   ` [PATCH -stable] sysfs: disable reclamation by default Maneesh Soni
2007-05-17 18:54           ` Oops and Panics in 2.6.21.1, 2.6.20.6 and 2.6.19.2 Eric Sandeen
2007-06-29  2:51 ` Clemens Schwaighofer
2007-06-29  6:12   ` Satyam Sharma
2007-06-29  6:18     ` Clemens Schwaighofer

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=20070610161847.GA12773@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@linux-foundation.org \
    --cc=cebbert@redhat.com \
    --cc=cs@tequila.co.jp \
    --cc=dipankar@in.ibm.com \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.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).