The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: rweight@us.ibm.com
Cc: 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 12:39:07 -0800	[thread overview]
Message-ID: <20050330123907.10740bc1.akpm@osdl.org> (raw)
In-Reply-To: <1112213392.25362.65.camel@russw.beaverton.ibm.com>

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?

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?

  reply	other threads:[~2005-03-30 20:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-30 20:09 [PATCH] Set MS_ACTIVE in isofs_fill_super() Russ Weight
2005-03-30 20:39 ` Andrew Morton [this message]
2005-03-30 22:20   ` Jan Harkes
2005-04-01 15:14     ` Jan Kara
2005-03-30 22:26   ` Russ Weight
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=20050330123907.10740bc1.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rweight@us.ibm.com \
    --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