mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russ Weight <rweight@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	"viro@parcelfarce.linux.theplanet.co.uk" 
	<viro@parcelfarce.linux.theplanet.co.uk>
Subject: Re: [PATCH] Set MS_ACTIVE in isofs_fill_super()
Date: Wed, 30 Mar 2005 14:26:59 -0800	[thread overview]
Message-ID: <1112221619.9858.89.camel@russw.beaverton.ibm.com> (raw)
In-Reply-To: <20050330123907.10740bc1.akpm@osdl.org>

On Wed, 2005-03-30 at 12:39 -0800, Andrew Morton wrote:
> Russ Weight <rweight@us.ibm.com> wrote:
> >
> > This patch sets the MS_ACTIVE bit in isofs_fill_super() prior to calling
> > iget() or iput(). This eliminates a race condition between mount
> > (for isofs) and kswapd that results in a system panic.
> > 
> > Signed-off-by: Russ Weight <rweight@us.ibm.com>
> > 
> > --- linux-2.6.12-rc1/fs/isofs/inode.c	2005-03-17 17:34:36.000000000
> > -0800
> > +++ linux-2.6.12-rc1-isofsfix/fs/isofs/inode.c	2005-03-22
> > 15:29:51.945607217 -0800
> > @@ -820,6 +820,7 @@
> >  	 * the s_rock flag. Once we have the final s_rock value,
> >  	 * we then decide whether to use the Joliet descriptor.
> >  	 */
> > +	s->s_flags |= MS_ACTIVE;
> >  	inode = isofs_iget(s, sbi->s_firstdatazone, 0);
> >  
> >  	/*
> > @@ -909,6 +910,7 @@
> >  		kfree(opt.iocharset);
> >  	kfree(sbi);
> >  	s->s_fs_info = NULL;
> > +	s->s_flags &= ~MS_ACTIVE;
> >  	return -EINVAL;
> >  }
> >  
> 
> The patch is obviously safe enough, but seems a bit kludgy.
> 
> The basic problem here appears to be that isofs is doing iget/iput in
> ->fill_super before MS_ACTIVE is set and the inode freeing code
> (generic_forget_inode) doesn't expect that to happen, yes?

Yes.

> I wonder if it would make more sense for all the ->fill_super callers to
> set MS_ACTIVE prior to calling ->fill_super(), and clear MS_ACTIVE if
> fill_super() failed?

It does seem a bit kludgy. I was trying keep the changes in isofs
specific code, and this seemed the best way to do it.

When you say "all the ->fill_super callers", are you referring to the
fill_super functions for all filesystems? Or just callers to
isofs_fill_super()?

isofs_fill_super() is called by get_sb_bdev(), which is in the generic
filesystem code. get_sb_bdev() receives a pointer as a parameter when it
is called from isofs_get_sb(). To make a change in get_sb_bdev() would
be to affect many (all?) filesystems. This may be the right thing to do
- although it seems a little heavy-weight since the failure hasn't been
reported in other filesystems.




  parent reply	other threads:[~2005-03-30 22:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-30 20:09 Russ Weight
2005-03-30 20:39 ` Andrew Morton
2005-03-30 22:20   ` Jan Harkes
2005-04-01 15:14     ` Jan Kara
2005-03-30 22:26   ` Russ Weight [this message]
2005-03-30 23:18     ` Jan Harkes

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=1112221619.9858.89.camel@russw.beaverton.ibm.com \
    --to=rweight@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®