linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Oleg Drokin <green@namesys.com>
Cc: reiser@namesys.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [2.6] reiserfs: fix locking in reiserfs_remount
Date: Thu, 7 Aug 2003 08:24:40 -0700	[thread overview]
Message-ID: <20030807082440.09b81626.akpm@osdl.org> (raw)
In-Reply-To: <20030807133358.GC20639@namesys.com>

Oleg Drokin <green@namesys.com> wrote:
>
> Hello!
> 
> On Thu, Aug 07, 2003 at 05:24:43PM +0400, Hans Reiser wrote:
> 
> > >Reiserfs needs BKL for it's journal operations. This is not "more",
> > >for some time BKL was taken in the VFS, then whoever removed that,
> > >forgot to propagate BKL down to actual fs methods that need the BKL.
> > Is it known who removed it?
> 
> I think it was Andrew. At least this new emergency remount path without
> BKL was introduced by his patch without any extra attribution.

Is that the only path?  It appears that way to me.

The Locking document says that ->remoutn_fs is called under lock_kernel(),
so this should be fixed at the VFS level.

 fs/super.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -puN fs/super.c~remount_fs-lock_kernel fs/super.c
--- 25/fs/super.c~remount_fs-lock_kernel	2003-08-07 08:17:38.000000000 -0700
+++ 25-akpm/fs/super.c	2003-08-07 08:23:42.000000000 -0700
@@ -507,8 +507,16 @@ static void do_emergency_remount(unsigne
 		sb->s_count++;
 		spin_unlock(&sb_lock);
 		down_read(&sb->s_umount);
-		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY))
+		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
+			/*
+			 * ->remount_fs needs lock_kernel().
+			 *
+			 * What lock protects sb->s_flags??
+			 */
+			lock_kernel();
 			do_remount_sb(sb, MS_RDONLY, NULL, 1);
+			unlock_kernel();
+		}
 		drop_super(sb);
 		spin_lock(&sb_lock);
 	}

_


  reply	other threads:[~2003-08-07 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-06  9:38 [PATCH] [2.6] reiserfs: fix locking in reiserfs_remount Oleg Drokin
2003-08-06 17:28 ` Mike Fedyk
2003-08-06 17:31   ` Oleg Drokin
2003-08-07 13:24     ` Hans Reiser
2003-08-07 13:33       ` Oleg Drokin
2003-08-07 15:24         ` Andrew Morton [this message]
2003-08-07 15:27           ` Oleg Drokin

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=20030807082440.09b81626.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=green@namesys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiser@namesys.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).