From: Miklos Szeredi <miklos@szeredi.hu>
To: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Jeff Mahoney <jeffm@suse.com>
Subject: [patch 22/26] mount options: fix reiserfs
Date: Thu, 24 Jan 2008 20:34:03 +0100 [thread overview]
Message-ID: <20080124193451.012194162@szeredi.hu> (raw)
In-Reply-To: <20080124193341.166753833@szeredi.hu>
[-- Attachment #1: reiserfs_opts.patch --]
[-- Type: text/plain, Size: 3773 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
Add a .show_options super operation to reiserfs.
Use generic_show_options() and save the complete option string in
reiserfs_fill_super() and reiserfs_remount().
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/fs/reiserfs/super.c
===================================================================
--- linux.orig/fs/reiserfs/super.c 2008-01-17 19:00:55.000000000 +0100
+++ linux/fs/reiserfs/super.c 2008-01-22 21:20:33.000000000 +0100
@@ -617,6 +617,7 @@ static const struct super_operations rei
.unlockfs = reiserfs_unlockfs,
.statfs = reiserfs_statfs,
.remount_fs = reiserfs_remount,
+ .show_options = generic_show_options,
#ifdef CONFIG_QUOTA
.quota_read = reiserfs_quota_read,
.quota_write = reiserfs_quota_write,
@@ -1138,6 +1139,7 @@ static int reiserfs_remount(struct super
unsigned long safe_mask = 0;
unsigned int commit_max_age = (unsigned int)-1;
struct reiserfs_journal *journal = SB_JOURNAL(s);
+ char *new_opts = kstrdup(arg, GFP_KERNEL);
int err;
#ifdef CONFIG_QUOTA
int i;
@@ -1153,7 +1155,8 @@ static int reiserfs_remount(struct super
REISERFS_SB(s)->s_qf_names[i] = NULL;
}
#endif
- return -EINVAL;
+ err = -EINVAL;
+ goto out_err;
}
handle_attrs(s);
@@ -1191,9 +1194,9 @@ static int reiserfs_remount(struct super
}
if (blocks) {
- int rc = reiserfs_resize(s, blocks);
- if (rc != 0)
- return rc;
+ err = reiserfs_resize(s, blocks);
+ if (err != 0)
+ goto out_err;
}
if (*mount_flags & MS_RDONLY) {
@@ -1201,16 +1204,16 @@ static int reiserfs_remount(struct super
/* remount read-only */
if (s->s_flags & MS_RDONLY)
/* it is read-only already */
- return 0;
+ goto out_ok;
/* try to remount file system with read-only permissions */
if (sb_umount_state(rs) == REISERFS_VALID_FS
|| REISERFS_SB(s)->s_mount_state != REISERFS_VALID_FS) {
- return 0;
+ goto out_ok;
}
err = journal_begin(&th, s, 10);
if (err)
- return err;
+ goto out_err;
/* Mounting a rw partition read-only. */
reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1);
@@ -1220,11 +1223,13 @@ static int reiserfs_remount(struct super
/* remount read-write */
if (!(s->s_flags & MS_RDONLY)) {
reiserfs_xattr_init(s, *mount_flags);
- return 0; /* We are read-write already */
+ goto out_ok; /* We are read-write already */
}
- if (reiserfs_is_journal_aborted(journal))
- return journal->j_errno;
+ if (reiserfs_is_journal_aborted(journal)) {
+ err = journal->j_errno;
+ goto out_err;
+ }
handle_data_mode(s, mount_options);
handle_barrier_mode(s, mount_options);
@@ -1232,7 +1237,7 @@ static int reiserfs_remount(struct super
s->s_flags &= ~MS_RDONLY; /* now it is safe to call journal_begin */
err = journal_begin(&th, s, 10);
if (err)
- return err;
+ goto out_err;
/* Mount a partition which is read-only, read-write */
reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1);
@@ -1247,7 +1252,7 @@ static int reiserfs_remount(struct super
SB_JOURNAL(s)->j_must_wait = 1;
err = journal_end(&th, s, 10);
if (err)
- return err;
+ goto out_err;
s->s_dirt = 0;
if (!(*mount_flags & MS_RDONLY)) {
@@ -1255,7 +1260,14 @@ static int reiserfs_remount(struct super
reiserfs_xattr_init(s, *mount_flags);
}
+out_ok:
+ kfree(s->s_options);
+ s->s_options = new_opts;
return 0;
+
+out_err:
+ kfree(new_opts);
+ return err;
}
static int read_super_block(struct super_block *s, int offset)
@@ -1559,6 +1571,8 @@ static int reiserfs_fill_super(struct su
struct reiserfs_sb_info *sbi;
int errval = -EINVAL;
+ save_mount_options(s, data);
+
sbi = kzalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL);
if (!sbi) {
errval = -ENOMEM;
--
next prev parent reply other threads:[~2008-01-24 19:42 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 19:33 [patch 00/26] mount options: fix filesystem's ->show_options Miklos Szeredi
2008-01-24 19:33 ` [patch 01/26] mount options: add documentation Miklos Szeredi
2008-01-25 0:24 ` Erez Zadok
2008-01-25 7:56 ` David Chinner
2008-01-25 10:02 ` Miklos Szeredi
2008-01-30 1:54 ` Roman Zippel
2008-01-30 9:09 ` Miklos Szeredi
2008-01-30 14:42 ` Karel Zak
2008-01-31 17:42 ` Miklos Szeredi
2008-02-08 19:20 ` Roman Zippel
2008-02-08 20:23 ` Miklos Szeredi
2008-01-24 19:33 ` [patch 02/26] mount options: add generic_show_options() Miklos Szeredi
2008-01-24 19:33 ` [patch 03/26] mount options: fix adfs Miklos Szeredi
2008-01-24 20:05 ` Russell King
2008-01-24 19:33 ` [patch 04/26] mount options: fix affs Miklos Szeredi
2008-01-24 19:33 ` [patch 05/26] mount options: fix afs Miklos Szeredi
2008-01-24 19:33 ` [patch 06/26] mount options: fix autofs4 Miklos Szeredi
2008-01-25 5:13 ` Ian Kent
2008-01-24 19:33 ` [patch 07/26] mount options: fix autofs Miklos Szeredi
2008-01-24 19:46 ` H. Peter Anvin
2008-01-24 19:33 ` [patch 08/26] mount options: fix befs Miklos Szeredi
2008-01-24 19:33 ` [patch 09/26] mount options: fix capifs Miklos Szeredi
2008-01-25 10:18 ` Karsten Keil
2008-01-24 19:33 ` [patch 10/26] mount options: fix devpts Miklos Szeredi
2008-01-24 19:46 ` H. Peter Anvin
2008-01-25 9:24 ` Miklos Szeredi
2008-01-24 19:33 ` [patch 11/26] mount options: fix ext2 Miklos Szeredi
2008-01-25 14:34 ` Jan Kara
2008-01-24 19:33 ` [patch 12/26] mount options: fix ext4 Miklos Szeredi
2008-01-25 6:41 ` Andreas Dilger
2008-01-25 14:37 ` Jan Kara
2008-01-25 17:35 ` Mingming Cao
2008-01-24 19:33 ` [patch 13/26] mount options: fix fat Miklos Szeredi
2008-01-24 19:33 ` [patch 14/26] mount options: fix fuse Miklos Szeredi
2008-01-24 19:33 ` [patch 15/26] mount options: fix hostfs Miklos Szeredi
2008-01-24 19:33 ` [patch 16/26] mount options: fix hpfs Miklos Szeredi
2008-01-24 19:33 ` [patch 17/26] mount options: fix hugetlbfs Miklos Szeredi
2008-01-24 19:33 ` [patch 18/26] mount options: fix isofs Miklos Szeredi
2008-01-25 14:42 ` Jan Kara
2008-01-24 19:34 ` [patch 19/26] mount options: fix jfs Miklos Szeredi
2008-01-24 21:15 ` Dave Kleikamp
2008-01-24 21:57 ` Andrew Morton
2008-01-24 22:17 ` Dave Kleikamp
2008-01-24 19:34 ` [patch 20/26] mount options: fix ncpfs Miklos Szeredi
2008-01-24 19:34 ` [patch 21/26] mount options: partially fix nfs Miklos Szeredi
2008-01-24 20:49 ` Chuck Lever
2008-01-25 9:39 ` Miklos Szeredi
2008-01-25 17:19 ` Chuck Lever
2008-01-28 11:34 ` Miklos Szeredi
2008-01-28 16:22 ` Chuck Lever
2008-01-24 20:53 ` Trond Myklebust
2008-01-25 9:43 ` Miklos Szeredi
2008-01-24 19:34 ` Miklos Szeredi [this message]
2008-01-24 19:34 ` [patch 23/26] mount options: fix spufs Miklos Szeredi
2008-01-24 19:34 ` [patch 24/26] mount options: fix tmpfs Miklos Szeredi
2008-01-28 6:09 ` Hugh Dickins
2008-01-28 11:40 ` Miklos Szeredi
2008-01-29 13:28 ` Hugh Dickins
2008-01-24 19:34 ` [patch 25/26] mount options: fix udf Miklos Szeredi
2008-01-24 19:51 ` Cyrill Gorcunov
2008-01-24 20:20 ` Cyrill Gorcunov
2008-01-25 9:29 ` Miklos Szeredi
2008-01-25 10:57 ` Cyrill Gorcunov
2008-01-25 13:41 ` Cyrill Gorcunov
2008-01-25 15:27 ` Jan Kara
2008-01-25 15:50 ` Miklos Szeredi
2008-01-25 15:57 ` Cyrill Gorcunov
2008-01-25 16:07 ` Jan Kara
2008-01-25 16:10 ` Miklos Szeredi
2008-01-24 20:40 ` Cyrill Gorcunov
2008-01-25 15:30 ` Jan Kara
2008-01-25 15:56 ` Miklos Szeredi
2008-01-25 16:04 ` Jan Kara
2008-01-24 19:34 ` [patch 26/26] mount options: fix usbfs Miklos Szeredi
2008-01-24 22:01 ` Greg KH
2008-01-25 9:54 ` Miklos Szeredi
2008-01-27 6:01 ` [patch 00/26] mount options: fix filesystem's ->show_options Andrew Morton
2008-01-28 11:36 ` Miklos Szeredi
2008-01-29 0:19 ` [patch 05/26] mount options: fix afs David Howells
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=20080124193451.012194162@szeredi.hu \
--to=miklos@szeredi.hu \
--cc=akpm@linux-foundation.org \
--cc=jeffm@suse.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®