All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: Greg KH <greg@kroah.com>, Andrew Morton <akpm@osdl.org>,
	maneesh@in.ibm.com, mgorse@mgorse.dhs.org,
	linux-kernel@vger.kernel.org
Cc: Patrick Mochel <mochel@digitalimplant.org>
Subject: Re: oopses in kobjects in 2.6.0-test11 (was Re: kobject patch)
Date: Sun, 28 Dec 2003 15:38:42 +0300	[thread overview]
Message-ID: <200312281538.42309.arvidjaar@mail.ru> (raw)
In-Reply-To: <20031208224810.GB31134@kroah.com>

On Tuesday 09 December 2003 01:48, Greg KH wrote:
> Ok, I'm ccing lkml and everyone else who has been in on this thread at
> different times.  This is based on a patch from Andrey that was/is in
> the -mm tree for a while.
>

what about second part in sysfs/dir.c? How relevant is it?

-andrey

>
> > > - after this oops has been fixed I got next one now in sysfs.  The
> > >   problem is sysfs_remove_dir would unlink all children including
> > >   directories for subordinate kobjects.  Resulting in dget/dput
> > > mismatch. I usually got oops due to the fact that d_delete in
> > > remove_dir would free inode and then simple_rmdir would try to access
> > > it.
> > >
> > >   The patch avoids calling extra d_delete/unlink on already-deleted
> > >   dentry.  I hate this patch but anything better apparently requires
> > >   complete redesign of sysfs implementation.  Unlinking busy directory
> > > is otherwise impossible and I am afraid it will show itself somewhere
> > > else.
> > >
> > >
> > >
> > >  25-akpm/fs/sysfs/dir.c |   12 ++++++++++--
> > >  25-akpm/lib/kobject.c  |    4 ++--
> > >  2 files changed, 12 insertions(+), 4 deletions(-)
> > >
> > > diff -puN fs/sysfs/dir.c~kobject-oops-fixes fs/sysfs/dir.c
> > > --- 25/fs/sysfs/dir.c~kobject-oops-fixes	Thu Oct  9 01:46:51 2003
> > > +++ 25-akpm/fs/sysfs/dir.c	Thu Oct  9 01:46:51 2003
> > > @@ -82,8 +82,16 @@ static void remove_dir(struct dentry * d
> > >  {
> > >  	struct dentry * parent = dget(d->d_parent);
> > >  	down(&parent->d_inode->i_sem);
> > > -	d_delete(d);
> > > -	simple_rmdir(parent->d_inode,d);
> > > +	/*
> > > +	 * It is possible that parent has already been removed, in which
> > > +	 * case directory is already unhashed and dput.
> > > +	 * Note that this won't update parent->d_inode->i_nlink; OTOH
> > > +	 * parent should already be dead
> > > +	 */
> > > +	if (!d_unhashed(d)) {
> > > +		d_delete(d);
> > > +		simple_rmdir(parent->d_inode,d);
> > > +	}
> > >
> > >  	pr_debug(" o %s removing done (%d)\n",d->d_name.name,
> > >  		 atomic_read(&d->d_count));


  parent reply	other threads:[~2003-12-28 12:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031009014837.4ff71634.akpm@osdl.org>
     [not found] ` <20031208222526.GA31134@kroah.com>
2003-12-08 22:48   ` oopses in kobjects in 2.6.0-test11 (was Re: kobject patch) Greg KH
2003-12-08 22:58     ` Greg KH
2003-12-11 16:51       ` Patrick Mochel
2003-12-11 17:50         ` Greg KH
2003-12-28 12:38     ` Andrey Borzenkov [this message]
2003-12-30  0:32       ` Greg KH

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=200312281538.42309.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    --cc=mgorse@mgorse.dhs.org \
    --cc=mochel@digitalimplant.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 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.