diff mbox series

[v2] ext2: add warning when specifying nocheck option

Message ID 20180607121907.13057-1-cgxu519@gmx.com
State Not Applicable, archived
Headers show
Series [v2] ext2: add warning when specifying nocheck option | expand

Commit Message

cgxu519 June 7, 2018, 12:19 p.m. UTC
The option nocheck(nocheck/check=none) is useless but considering
backwards compatibility it's better to print warning for a while
before completely remove from the code.

This patch add proper warning message for option 'nocheck' and
remove unnecessary comment/function declaration which is used for
removed option 'check'.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
v1->v2:
- Keep option nocheck as is and only add warning message.

 fs/ext2/ext2.h  | 2 --
 fs/ext2/super.c | 5 ++---
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

Darrick Wong June 7, 2018, 3:18 p.m. UTC | #1
On Thu, Jun 07, 2018 at 08:19:07PM +0800, Chengguang Xu wrote:
> The option nocheck(nocheck/check=none) is useless but considering
> backwards compatibility it's better to print warning for a while
> before completely remove from the code.
> 
> This patch add proper warning message for option 'nocheck' and
> remove unnecessary comment/function declaration which is used for
> removed option 'check'.
> 
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> ---
> v1->v2:
> - Keep option nocheck as is and only add warning message.
> 
>  fs/ext2/ext2.h  | 2 --
>  fs/ext2/super.c | 5 ++---
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
> index cc40802ddfa8..00e759f05161 100644
> --- a/fs/ext2/ext2.h
> +++ b/fs/ext2/ext2.h
> @@ -748,7 +748,6 @@ extern void ext2_free_blocks (struct inode *, unsigned long,
>  			      unsigned long);
>  extern unsigned long ext2_count_free_blocks (struct super_block *);
>  extern unsigned long ext2_count_dirs (struct super_block *);
> -extern void ext2_check_blocks_bitmap (struct super_block *);
>  extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
>  						    unsigned int block_group,
>  						    struct buffer_head ** bh);
> @@ -771,7 +770,6 @@ extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page
>  extern struct inode * ext2_new_inode (struct inode *, umode_t, const struct qstr *);
>  extern void ext2_free_inode (struct inode *);
>  extern unsigned long ext2_count_free_inodes (struct super_block *);
> -extern void ext2_check_inodes_bitmap (struct super_block *);
>  extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
>  
>  /* inode.c */
> diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> index c09289a42dc5..a1adfcf77d73 100644
> --- a/fs/ext2/super.c
> +++ b/fs/ext2/super.c
> @@ -557,6 +557,8 @@ static int parse_options(char *options, struct super_block *sb,
>  			set_opt (opts->s_mount_opt, NO_UID32);
>  			break;
>  		case Opt_nocheck:
> +			ext2_msg(sb, KERN_WARNING,
> +				"Option nocheck/check=none is deprecated and will be removed in the future.");

You might want to supply a specific deprecation schedule:

"..and will be removed in June 2020."

--D

>  			clear_opt (opts->s_mount_opt, CHECK);
>  			break;
>  		case Opt_debug:
> @@ -1333,9 +1335,6 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
>  	new_opts.s_resgid = sbi->s_resgid;
>  	spin_unlock(&sbi->s_lock);
>  
> -	/*
> -	 * Allow the "check" option to be passed as a remount option.
> -	 */
>  	if (!parse_options(data, sb, &new_opts))
>  		return -EINVAL;
>  
> -- 
> 2.17.1
>
Jan Kara June 7, 2018, 3:28 p.m. UTC | #2
On Thu 07-06-18 08:18:55, Darrick J. Wong wrote:
> On Thu, Jun 07, 2018 at 08:19:07PM +0800, Chengguang Xu wrote:
> > The option nocheck(nocheck/check=none) is useless but considering
> > backwards compatibility it's better to print warning for a while
> > before completely remove from the code.
> > 
> > This patch add proper warning message for option 'nocheck' and
> > remove unnecessary comment/function declaration which is used for
> > removed option 'check'.
> > 
> > Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> > ---
> > v1->v2:
> > - Keep option nocheck as is and only add warning message.
> > 
> >  fs/ext2/ext2.h  | 2 --
> >  fs/ext2/super.c | 5 ++---
> >  2 files changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
> > index cc40802ddfa8..00e759f05161 100644
> > --- a/fs/ext2/ext2.h
> > +++ b/fs/ext2/ext2.h
> > @@ -748,7 +748,6 @@ extern void ext2_free_blocks (struct inode *, unsigned long,
> >  			      unsigned long);
> >  extern unsigned long ext2_count_free_blocks (struct super_block *);
> >  extern unsigned long ext2_count_dirs (struct super_block *);
> > -extern void ext2_check_blocks_bitmap (struct super_block *);
> >  extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
> >  						    unsigned int block_group,
> >  						    struct buffer_head ** bh);
> > @@ -771,7 +770,6 @@ extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page
> >  extern struct inode * ext2_new_inode (struct inode *, umode_t, const struct qstr *);
> >  extern void ext2_free_inode (struct inode *);
> >  extern unsigned long ext2_count_free_inodes (struct super_block *);
> > -extern void ext2_check_inodes_bitmap (struct super_block *);
> >  extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
> >  
> >  /* inode.c */
> > diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> > index c09289a42dc5..a1adfcf77d73 100644
> > --- a/fs/ext2/super.c
> > +++ b/fs/ext2/super.c
> > @@ -557,6 +557,8 @@ static int parse_options(char *options, struct super_block *sb,
> >  			set_opt (opts->s_mount_opt, NO_UID32);
> >  			break;
> >  		case Opt_nocheck:
> > +			ext2_msg(sb, KERN_WARNING,
> > +				"Option nocheck/check=none is deprecated and will be removed in the future.");
> 
> You might want to supply a specific deprecation schedule:
> 
> "..and will be removed in June 2020."

Yeah, that's probably even better. Thanks for the suggestion.

								Honza
diff mbox series

Patch

diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
index cc40802ddfa8..00e759f05161 100644
--- a/fs/ext2/ext2.h
+++ b/fs/ext2/ext2.h
@@ -748,7 +748,6 @@  extern void ext2_free_blocks (struct inode *, unsigned long,
 			      unsigned long);
 extern unsigned long ext2_count_free_blocks (struct super_block *);
 extern unsigned long ext2_count_dirs (struct super_block *);
-extern void ext2_check_blocks_bitmap (struct super_block *);
 extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
 						    unsigned int block_group,
 						    struct buffer_head ** bh);
@@ -771,7 +770,6 @@  extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page
 extern struct inode * ext2_new_inode (struct inode *, umode_t, const struct qstr *);
 extern void ext2_free_inode (struct inode *);
 extern unsigned long ext2_count_free_inodes (struct super_block *);
-extern void ext2_check_inodes_bitmap (struct super_block *);
 extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
 
 /* inode.c */
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index c09289a42dc5..a1adfcf77d73 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -557,6 +557,8 @@  static int parse_options(char *options, struct super_block *sb,
 			set_opt (opts->s_mount_opt, NO_UID32);
 			break;
 		case Opt_nocheck:
+			ext2_msg(sb, KERN_WARNING,
+				"Option nocheck/check=none is deprecated and will be removed in the future.");
 			clear_opt (opts->s_mount_opt, CHECK);
 			break;
 		case Opt_debug:
@@ -1333,9 +1335,6 @@  static int ext2_remount (struct super_block * sb, int * flags, char * data)
 	new_opts.s_resgid = sbi->s_resgid;
 	spin_unlock(&sbi->s_lock);
 
-	/*
-	 * Allow the "check" option to be passed as a remount option.
-	 */
 	if (!parse_options(data, sb, &new_opts))
 		return -EINVAL;