linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Andreas Dilger <adilger@sun.com>
Cc: tytso@mit.edu, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: [PATCH] ext4: deprecate obsoleted mount options v2
Date: Tue, 23 Feb 2010 22:23:45 +0300	[thread overview]
Message-ID: <87bpffpxha.fsf_-_@openvz.org> (raw)
In-Reply-To: <57C5D8FD-F729-4C01-8485-6E76E7D2BDE6@sun.com> (Andreas Dilger's message of "Mon, 22 Feb 2010 17:28:12 -0700")

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

Andreas Dilger <adilger@sun.com> writes:

> On 2010-02-19, at 07:39, Dmitry Monakhov wrote:
>> This patch deprecate some obsoleted functions.
>> It is not obvious what should we do in case of deprecated options on
>> mount.
>> Just printk and continue or fail the mount, i've implemented the
>> last one.
>> BTW: Do we need similar patch for e2fslib?
>
> I think deprecating an option is not the same as removing it entirely.
Ohh.. I've hoped to reuse freed bits for new crap.
> Even though I don't think these options are in wide usage,  I'd still
> prefer to add a printk() to the parsing code first, leave it  for a
> year, then remove them entirely after that.
So option deprecation result in code boosting instead of code shrinkage.
Indeed the second law of thermodynamics is absolutely true.
New version attached.


[-- Attachment #2: 0001-ext4-deprecate-obsoleted-mount-options-v2.patch --]
[-- Type: text/plain, Size: 5021 bytes --]

>From 0d12e733a6dd87ed3bc4dea27126f6e814b5586b Mon Sep 17 00:00:00 2001
From: Dmitry Monakhov <dmonakhov@openvz.org>
Date: Tue, 23 Feb 2010 22:11:47 +0300
Subject: [PATCH] ext4: deprecate obsoleted mount options v2

Declare following list of mount options as deprecated:
 - bsddf, miniddf
 - grpid, bsdgroups, nogrpid, sysvgroups

Declare following list of default mount options as deprecated:
 - bsdgroups

Changes from v1
 - Mark options as deprecated instead of disabling it completely,
   they will be disabled after exportation period.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext4/ext4.h  |    2 +
 fs/ext4/super.c |   76 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 73 insertions(+), 5 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 67859fa..66ed482 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1185,6 +1185,8 @@ static inline void ext4_clear_inode_state(struct inode *inode, int bit)
 #define EXT4_DEFM_JMODE_DATA	0x0020
 #define EXT4_DEFM_JMODE_ORDERED	0x0040
 #define EXT4_DEFM_JMODE_WBACK	0x0060
+/* Deprecated default mount options mask */
+#define EXT4_DEFM_DEPRECATED	EXT4_DEFM_BSDGROUPS
 
 /*
  * Default journal batch times
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d5596ca..d07f506 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1114,7 +1114,7 @@ enum {
 	Opt_block_validity, Opt_noblock_validity,
 	Opt_inode_readahead_blks, Opt_journal_ioprio,
 	Opt_dioread_nolock, Opt_dioread_lock,
-	Opt_discard, Opt_nodiscard,
+	Opt_discard, Opt_nodiscard, Opt_deprecated, Opt_disabled,
 };
 
 static const match_table_t tokens = {
@@ -1188,6 +1188,18 @@ static const match_table_t tokens = {
 	{Opt_err, NULL},
 };
 
+static const match_table_t default_mountopt = {
+	{EXT4_DEFM_DEBUG, "debug"},
+	{EXT4_DEFM_BSDGROUPS, "bsdgroups"},
+	{EXT4_DEFM_XATTR_USER, "user_xattr"},
+	{EXT4_DEFM_ACL, "acl"},
+	{EXT4_DEFM_UID16, "uid16"},
+	{EXT4_DEFM_JMODE_WBACK, "journal_data_writeback"},
+	{EXT4_DEFM_JMODE_DATA, "journal_data"},
+	{EXT4_DEFM_JMODE_ORDERED, "journal_data_ordered"},
+	{0, NULL},
+};
+
 static ext4_fsblk_t get_sb_block(void **data)
 {
 	ext4_fsblk_t	sb_block;
@@ -1240,16 +1252,16 @@ static int parse_options(char *options, struct super_block *sb,
 		switch (token) {
 		case Opt_bsd_df:
 			clear_opt(sbi->s_mount_opt, MINIX_DF);
-			break;
+			goto deprecated;
 		case Opt_minix_df:
 			set_opt(sbi->s_mount_opt, MINIX_DF);
-			break;
+			goto deprecated;
 		case Opt_grpid:
 			set_opt(sbi->s_mount_opt, GRPID);
-			break;
+			goto deprecated;
 		case Opt_nogrpid:
 			clear_opt(sbi->s_mount_opt, GRPID);
-			break;
+			goto deprecated;
 		case Opt_resuid:
 			if (match_int(&args[0], &option))
 				return 0;
@@ -1622,6 +1634,21 @@ set_qf_format:
 		case Opt_dioread_lock:
 			clear_opt(sbi->s_mount_opt, DIOREAD_NOLOCK);
 			break;
+
+		case Opt_deprecated:
+deprecated:
+			ext4_msg(sb, KERN_ERR,
+				"Deprecated mount option \"%s\". Will be "
+				"removed soon. Please contact "
+				"linux-ext4@vger.kernel.org if you are still "
+				"using it.", p);
+			break;
+
+		case Opt_disabled:
+			ext4_msg(sb, KERN_ERR,
+				"Deprecated mount option \"%s\". And not "
+				"longer supported.", p);
+			return 0;
 		default:
 			ext4_msg(sb, KERN_ERR,
 			       "Unrecognized mount option \"%s\" "
@@ -2358,7 +2385,42 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
 	}
 	return 1;
 }
+static int handle_deprecated_defmopt(struct super_block *sb, unsigned int opt)
+{
+	int first = 1;
+	/*
+	 * When deprecated options are found they are not cleared from
+	 * super block by default. Just print error message and let
+	 * user clear it manually.
+	 */
+	printk(KERN_ERR "EXT4-fs (%s) Deprecated default mount options:",
+		sb->s_id);
+	/*
+	 * It is impossible to use simple bit traversing because,
+	 * some options use shared bits.
+	 */
+	opt &= EXT4_DEFM_DEPRECATED;
+	while (opt) {
+		const struct match_token *mt = default_mountopt;
+		while (mt->pattern != NULL) {
+			if ((opt & mt->token) == mt->token)
+				break;
+			mt++;
+		}
+		if (mt->pattern == NULL) {
+			printk("%s unknown", !first ? "," : "");
+			break;
+		} else {
+			printk("%s %s", !first ? "," : "", mt->pattern);
+			opt &= ~mt->token;
+		}
+		first = 0;
+	}
+	printk(". Please use tune2fs to disable it, or contact "
+		"linux-ext4@vger.kernel.org if you are still need it.");
 
+	return 0;
+}
 static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 				__releases(kernel_lock)
 				__acquires(kernel_lock)
@@ -2443,6 +2505,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 
 	/* Set defaults before we parse the mount options */
 	def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
+	if (def_mount_opts & EXT4_DEFM_DEPRECATED) {
+		if (handle_deprecated_defmopt(sb, def_mount_opts))
+			goto failed_mount;
+	}
 	if (def_mount_opts & EXT4_DEFM_DEBUG)
 		set_opt(sbi->s_mount_opt, DEBUG);
 	if (def_mount_opts & EXT4_DEFM_BSDGROUPS)
-- 
1.6.6


  reply	other threads:[~2010-02-23 19:23 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-17 18:29 [PATCH 00/19] fs cleanup: remove duplicated code on inode init Dmitry Monakhov
2010-02-17 18:34 ` [PATCH 01/19] vfs: Add inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 23:03   ` James Morris
2010-02-18  6:57     ` [PATCH 01/19] vfs: Add inode uid,gid,mode init helper v2 Dmitry Monakhov
2010-02-17 18:36 ` [PATCH 02/19] 9p: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 18:37 ` [PATCH 03/19] bfs: " Dmitry Monakhov
2010-02-17 18:38 ` [PATCH 04/19] btrfs: " Dmitry Monakhov
2010-02-17 18:39 ` [PATCH 05/19] exofs: " Dmitry Monakhov
2010-02-20  0:15   ` Boaz Harrosh
2010-02-17 18:40 ` [PATCH 06/19] ext2: " Dmitry Monakhov
2010-02-18  1:21   ` Jan Kara
2010-02-18  7:00     ` [PATCH 06/19] ext2: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-18 18:49       ` Jan Kara
2010-02-17 18:40 ` [PATCH 07/19] ext3: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-18  7:02   ` [PATCH 07/19] ext3: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-17 18:40 ` [PATCH 08/19] ext4: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 23:39   ` Andreas Dilger
2010-02-18  7:09     ` [PATCH 08/19] ext4: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-18 20:52     ` [PATCH 08/19] ext4: replace inode uid,gid,mode initialization with helper function tytso
2010-02-19 10:30       ` Dmitry Monakhov
2010-02-19 14:39       ` [PATCH] ext4: deprecate obsoleted mount options Dmitry Monakhov
2010-02-23  0:28         ` Andreas Dilger
2010-02-23 19:23           ` Dmitry Monakhov [this message]
2010-02-23 20:13             ` [PATCH] ext4: deprecate obsoleted mount options v2 tytso
2010-02-24 18:12               ` [PATCH] ext4: deprecate obsoleted mount options v3 Dmitry Monakhov
2010-03-02  3:43                 ` tytso
2010-02-17 18:41 ` [PATCH 09/19] jfs: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 21:57   ` Dave Kleikamp
2010-02-18  7:12     ` [PATCH 09/19] jfs: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-17 18:41 ` [PATCH 10/19] minix: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov
2010-02-17 18:42 ` [PATCH 11/19] nilfs2: " Dmitry Monakhov
2010-02-18  1:28   ` Ryusuke Konishi
2010-02-17 18:43 ` [PATCH 12/19] ocfs2: " Dmitry Monakhov
2010-02-18  4:07   ` Joel Becker
2010-02-17 18:44 ` [PATCH 13/19] omfs: " Dmitry Monakhov
2010-02-17 18:44 ` [PATCH 14/19] ramfs: " Dmitry Monakhov
2010-02-17 18:45 ` [PATCH 15/19] reiserfs: " Dmitry Monakhov
2010-02-17 18:45 ` [PATCH 16/19] sysv: " Dmitry Monakhov
2010-02-17 18:46 ` [PATCH 17/19] ubifs: " Dmitry Monakhov
2010-02-18 10:54   ` Artem Bityutskiy
2010-02-17 18:47 ` [PATCH 18/19] udf: " Dmitry Monakhov
2010-02-17 23:43   ` Jan Kara
2010-02-18  7:18     ` [PATCH 18/19] udf: replace inode uid,gid,mode init with helper v2 Dmitry Monakhov
2010-02-18 18:53       ` Jan Kara
2010-02-18 19:55         ` [PATCH 18/19] udf: replace inode uid,gid,mode init with helper v3 Dmitry Monakhov
2010-02-19 10:56           ` Jan Kara
2010-02-17 18:47 ` [PATCH 19/19] ufs: replace inode uid,gid,mode initialization with helper function Dmitry Monakhov

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=87bpffpxha.fsf_-_@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=adilger@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).