From: Artem Bityutskiy <dedekind1@gmail.com>
To: Adrian Hunter <adrian.hunter@nokia.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"Bityutskiy Artem (Nokia-D/Helsinki)"
<Artem.Bityutskiy@nokia.com>
Subject: Re: [PATCH] UBIFS: kill BKL
Date: Mon, 20 Jul 2009 13:26:11 +0300 [thread overview]
Message-ID: <1248085571.6140.11.camel@localhost> (raw)
In-Reply-To: <4A640BBF.10106@nokia.com>
On Mon, 2009-07-20 at 09:16 +0300, Adrian Hunter wrote:
> Artem Bityutskiy wrote:
> > From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
> >
> > The BKL was pushed down from VFS to the file-systems. It used
> > to serialize mount/unmount/remount. UBIFS must be safe if several
> > file-systems are mounted/unmounted/re-mounted at the same time,
> > so kill kick the BKL out of UBIFS.
> >
> > Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
> > ---
>
> Looks like protection is always provided by sb->s_umount
Not for 2 or more instances of fs mounted/umounted/remounted at
the same time, which I meant in my comment. But I've fixed the
comment.
> Missing {} below, btw.
New version is below.
>From 347a38db88429400f0f479dc4d7de2b673999433 Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Date: Sun, 19 Jul 2009 13:51:04 +0300
Subject: [PATCH] UBIFS: kill BKL
The BKL was pushed down from VFS to the file-systems. It used
to serialize mount/unmount/remount and prevented more than one
instance of the same file-system from doing
mount/umount/remount at the same time. But it is OK for UBIFS
and it does not need any additional locking for these cases.
Thus, kick the BKL out of UBIFS.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
Changelog: fixed parentheses
remove #include <linux/smp_lock.h>
fs/ubifs/super.c | 13 +------------
1 files changed, 1 insertions(+), 12 deletions(-)
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 26d2e0d..13e7ed4 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -36,7 +36,6 @@
#include <linux/mount.h>
#include <linux/math64.h>
#include <linux/writeback.h>
-#include <linux/smp_lock.h>
#include "ubifs.h"
/*
@@ -1726,8 +1725,6 @@ static void ubifs_put_super(struct super_block *sb)
ubifs_msg("un-mount UBI device %d, volume %d", c->vi.ubi_num,
c->vi.vol_id);
- lock_kernel();
-
/*
* The following asserts are only valid if there has not been a failure
* of the media. For example, there will be dirty inodes if we failed
@@ -1792,8 +1789,6 @@ static void ubifs_put_super(struct super_block *sb)
ubi_close_volume(c->ubi);
mutex_unlock(&c->umount_mutex);
kfree(c);
-
- unlock_kernel();
}
static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
@@ -1809,22 +1804,17 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
return err;
}
- lock_kernel();
if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
if (c->ro_media) {
ubifs_msg("cannot re-mount due to prior errors");
- unlock_kernel();
return -EROFS;
}
err = ubifs_remount_rw(c);
- if (err) {
- unlock_kernel();
+ if (err)
return err;
- }
} else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
if (c->ro_media) {
ubifs_msg("cannot re-mount due to prior errors");
- unlock_kernel();
return -EROFS;
}
ubifs_remount_ro(c);
@@ -1839,7 +1829,6 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
}
ubifs_assert(c->lst.taken_empty_lebs > 0);
- unlock_kernel();
return 0;
}
--
1.6.0.6
next prev parent reply other threads:[~2009-07-20 10:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-19 10:55 [PATCH] UBIFS: kill BKL Artem Bityutskiy
2009-07-20 6:16 ` Adrian Hunter
2009-07-20 6:27 ` Artem Bityutskiy
2009-07-20 6:29 ` Artem Bityutskiy
2009-07-20 6:35 ` Adrian Hunter
2009-07-20 10:26 ` Artem Bityutskiy [this message]
2009-07-20 12:51 ` Christoph Hellwig
2009-07-20 13:22 ` Artem Bityutskiy
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=1248085571.6140.11.camel@localhost \
--to=dedekind1@gmail.com \
--cc=Artem.Bityutskiy@nokia.com \
--cc=adrian.hunter@nokia.com \
--cc=linux-fsdevel@vger.kernel.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 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).