ext4: remove a couple mount options
cover ext4: remove a couple mount options
I think that the journal=update and resize mount options are a bit pointless these days, so here are patches to remove them.
I'm not adamant about it, but thought I'd put it out there as a proposal, after looking at our long list of mount options and the testing requirements for it.
-Eric
PATCH 1/2 ext4: remove a the journal=update mount option
The V2 journal format was introduced around ten years ago, for ext3. It seems highly unlikely that anyone will need this migration option for ext4.
--- Documentation/filesystems/ext4.txt | 3 - fs/ext4/super.c | 26 ---------------- fs/jbd2/journal.c | 57 ------------------------------------- 3 files changed, 1 insertion(+), 85 deletions(-)
Documentation/filesystems/ext4.txt +0 -3
@@ -144,9 +144,6 @@ journal_async_commit Commit block can be written to disk without waiting mount the device. This will enable 'journal_checksum' internally. -journal=update Update the ext4 file system's journal to the current - format. - journal_dev=devnum When the external journal device's major/minor numbers have changed, this option allows the user to specify the new journal location. The journal device is
fs/ext4/super.c +1 -25
@@ -1306,8 +1306,7 @@ enum { Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_auto_da_alloc, Opt_noauto_da_alloc, Opt_noload, Opt_nobh, Opt_bh, Opt_commit, Opt_min_batch_time, Opt_max_batch_time, - Opt_journal_update, Opt_journal_dev, - Opt_journal_checksum, Opt_journal_async_commit, + Opt_journal_dev, Opt_journal_checksum, Opt_journal_async_commit, Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback, Opt_data_err_abort, Opt_data_err_ignore, Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
@@ -1350,7 +1349,6 @@ static const match_table_t tokens = { {Opt_commit, "commit=%u"}, {Opt_min_batch_time, "min_batch_time=%u"}, {Opt_max_batch_time, "max_batch_time=%u"}, - {Opt_journal_update, "journal=update"}, {Opt_journal_dev, "journal_dev=%u"}, {Opt_journal_checksum, "journal_checksum"}, {Opt_journal_async_commit, "journal_async_commit"},
@@ -1598,19 +1596,6 @@ static int parse_options(char *options, struct super_block *sb,ext4_msg (sb,KERN_ERR ,"(no)acl options not supported" );break ;#endif -case Opt_journal_update: -/* @@@ FIXME */ -/* Eventually we will want to be able to create -a journal file here. For now, only allow the -user to specify an existing inode to be the -journal file. */ -if (is_remount) { -ext4_msg (sb,KERN_ERR , -"Cannot specify journal on remount" ); -return 0 ; - } -set_opt (sb,UPDATE_JOURNAL ); -break ;case Opt_journal_dev:if (is_remount) { ext4_msg(sb, KERN_ERR,
@@ -4015,15 +4000,6 @@ static int ext4_load_journal(struct super_block *sb,if (!(journal->j_flags &JBD2_BARRIER ))ext4_msg (sb,KERN_INFO ,"barriers disabled" ); -if (!really_read_only &&test_opt (sb,UPDATE_JOURNAL )) { - err =jbd2_journal_update_format (journal); -if (err) { -ext4_msg (sb,KERN_ERR ,"error updating journal" ); -jbd2_journal_destroy (journal); -return err; - } - } -if (!EXT4_HAS_INCOMPAT_FEATURE (sb,EXT4_FEATURE_INCOMPAT_RECOVER )) err =jbd2_journal_wipe (journal, !really_read_only);if (!err) {
fs/jbd2/journal.c +0 -55
70 lines not on this page · raw message
Re: [PATCH 1/2] ext4: remove a the journal=update mount option
Quoted 5 lines · Eric Sandeen
The V2 journal format was introduced around ten years ago, for ext3. It seems highly unlikely that anyone will need this migration option for ext4.
Signed-off-by Eric Sandeen <[email protected]>
Applied, thanks.
- Ted
PATCH 2/2 ext4: remove a couple mount options
In reply to Eric SandeenThe resize mount option seems to be of limited value, especially in the age of online resize2fs. Nuke it.
--- Documentation/filesystems/ext4.txt | 5 ----- fs/ext4/super.c | 29 ++++++----------------------- 2 files changed, 6 insertions(+), 28 deletions(-)
Documentation/filesystems/ext4.txt +0 -5
@@ -362,11 +362,6 @@ nouid32 Disables 32-bit UIDs and GIDs. This is for interoperability with older kernels which only store and expect 16-bit values. -resize Allows to resize filesystem to the end of the last - existing block group, further resize has to be done - with resize2fs either online, or offline. It can be - used only with conjunction with remount. - block_validity This options allows to enables/disables the in-kernel noblock_validity facility for tracking filesystem metadata blocks within internal data structures. This allows multi-
fs/ext4/super.c +6 -23
@@ -1312,7 +1312,7 @@ enum { Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota, Opt_noquota, Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err, - Opt_resize, Opt_usrquota, Opt_grpquota, Opt_i_version, + Opt_usrquota, Opt_grpquota, Opt_i_version, Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit, Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, Opt_inode_readahead_blks, Opt_journal_ioprio,
@@ -1374,7 +1374,6 @@ static const match_table_t tokens = { {Opt_nobarrier, "nobarrier"}, {Opt_i_version, "i_version"}, {Opt_stripe, "stripe=%u"}, - {Opt_resize, "resize"}, {Opt_delalloc, "delalloc"}, {Opt_nodelalloc, "nodelalloc"}, {Opt_mblk_io_submit, "mblk_io_submit"},
@@ -1484,7 +1483,7 @@ static int clear_qf_name(struct super_block *sb, int qtype)static int parse_options (char *options,struct super_block *sb,unsigned long *journal_devnum,unsigned int *journal_ioprio, -ext4_fsblk_t *n_blocks_count,int is_remount) +int is_remount) {struct ext4_sb_info *sbi =EXT4_SB (sb);char *p;
@@ -1761,17 +1760,6 @@ set_qf_format:break ;case Opt_ignore:break ; -case Opt_resize: -if (!is_remount) { -ext4_msg (sb,KERN_ERR , -"resize option only available " -"for remount" ); -return 0 ; - } -if (match_int (&args[0 ], &option) !=0 ) -return 0 ; - *n_blocks_count = option; -break ;case Opt_nobh:ext4_msg (sb,KERN_WARNING ,"Ignoring deprecated nobh option" );
@@ -3200,13 +3188,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_li_wait_mult =EXT4_DEF_LI_WAIT_MULT ;if (!parse_options ((char *) sbi->s_es->s_mount_opts, sb, - &journal_devnum, &journal_ioprio,NULL ,0 )) { + &journal_devnum, &journal_ioprio,0 )) {ext4_msg (sb,KERN_WARNING ,"failed to parse options in superblock: %s" , sbi->s_es->s_mount_opts); }if (!parse_options ((char *) data, sb, &journal_devnum, - &journal_ioprio,NULL ,0 )) + &journal_ioprio,0 )) goto failed_mount; sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
@@ -4285,7 +4273,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) {struct ext4_super_block *es;struct ext4_sb_info *sbi =EXT4_SB (sb); -ext4_fsblk_t n_blocks_count =0 ;unsigned long old_sb_flags;struct ext4_mount_options old_opts;int enable_quota =0 ;
@@ -4318,8 +4305,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)/* * Allow the "check" option to be passed as a remount option. */ -if (!parse_options (data, sb,NULL , &journal_ioprio, - &n_blocks_count,1 )) { +if (!parse_options (data, sb,NULL , &journal_ioprio,1 )) { err = -EINVAL ; goto restore_opts; }
@@ -4337,8 +4323,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)set_task_ioprio (sbi->s_journal->j_task, journal_ioprio); } -if ((*flags &MS_RDONLY ) != (sb->s_flags &MS_RDONLY ) || - n_blocks_count >ext4_blocks_count (es)) { +if ((*flags &MS_RDONLY ) != (sb->s_flags &MS_RDONLY )) {if (sbi->s_mount_flags &EXT4_MF_FS_ABORTED ) { err = -EROFS ; goto restore_opts;
@@ -4413,8 +4398,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)if (sbi->s_journal)ext4_clear_journal_err (sb, es); sbi->s_mount_state =le16_to_cpu (es->s_state); -if ((err =ext4_group_extend (sb, es, n_blocks_count))) - goto restore_opts;if (!ext4_setup_super (sb, es,0 )) sb->s_flags &= ~MS_RDONLY ; if (EXT4_HAS_INCOMPAT_FEATURE(sb,
PATCH v2 2/2 ext4: remove the resize mount option
The resize mount option seems to be of limited value, especially in the age of online resize2fs. Nuke it.
---
V2: get the subject right.
Documentation/filesystems/ext4.txt | 5 ----- fs/ext4/super.c | 29 ++++++----------------------- 2 files changed, 6 insertions(+), 28 deletions(-)
Documentation/filesystems/ext4.txt +0 -5
@@ -362,11 +362,6 @@ nouid32 Disables 32-bit UIDs and GIDs. This is for interoperability with older kernels which only store and expect 16-bit values. -resize Allows to resize filesystem to the end of the last - existing block group, further resize has to be done - with resize2fs either online, or offline. It can be - used only with conjunction with remount. - block_validity This options allows to enables/disables the in-kernel noblock_validity facility for tracking filesystem metadata blocks within internal data structures. This allows multi-
fs/ext4/super.c +6 -23
@@ -1312,7 +1312,7 @@ enum { Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota, Opt_noquota, Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err, - Opt_resize, Opt_usrquota, Opt_grpquota, Opt_i_version, + Opt_usrquota, Opt_grpquota, Opt_i_version, Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit, Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, Opt_inode_readahead_blks, Opt_journal_ioprio,
@@ -1374,7 +1374,6 @@ static const match_table_t tokens = { {Opt_nobarrier, "nobarrier"}, {Opt_i_version, "i_version"}, {Opt_stripe, "stripe=%u"}, - {Opt_resize, "resize"}, {Opt_delalloc, "delalloc"}, {Opt_nodelalloc, "nodelalloc"}, {Opt_mblk_io_submit, "mblk_io_submit"},
@@ -1484,7 +1483,7 @@ static int clear_qf_name(struct super_block *sb, int qtype)static int parse_options (char *options,struct super_block *sb,unsigned long *journal_devnum,unsigned int *journal_ioprio, -ext4_fsblk_t *n_blocks_count,int is_remount) +int is_remount) {struct ext4_sb_info *sbi =EXT4_SB (sb);char *p;
@@ -1761,17 +1760,6 @@ set_qf_format:break ;case Opt_ignore:break ; -case Opt_resize: -if (!is_remount) { -ext4_msg (sb,KERN_ERR , -"resize option only available " -"for remount" ); -return 0 ; - } -if (match_int (&args[0 ], &option) !=0 ) -return 0 ; - *n_blocks_count = option; -break ;case Opt_nobh:ext4_msg (sb,KERN_WARNING ,"Ignoring deprecated nobh option" );
@@ -3200,13 +3188,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_li_wait_mult =EXT4_DEF_LI_WAIT_MULT ;if (!parse_options ((char *) sbi->s_es->s_mount_opts, sb, - &journal_devnum, &journal_ioprio,NULL ,0 )) { + &journal_devnum, &journal_ioprio,0 )) {ext4_msg (sb,KERN_WARNING ,"failed to parse options in superblock: %s" , sbi->s_es->s_mount_opts); }if (!parse_options ((char *) data, sb, &journal_devnum, - &journal_ioprio,NULL ,0 )) + &journal_ioprio,0 )) goto failed_mount; sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
@@ -4285,7 +4273,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) {struct ext4_super_block *es;struct ext4_sb_info *sbi =EXT4_SB (sb); -ext4_fsblk_t n_blocks_count =0 ;unsigned long old_sb_flags;struct ext4_mount_options old_opts;int enable_quota =0 ;
@@ -4318,8 +4305,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)/* * Allow the "check" option to be passed as a remount option. */ -if (!parse_options (data, sb,NULL , &journal_ioprio, - &n_blocks_count,1 )) { +if (!parse_options (data, sb,NULL , &journal_ioprio,1 )) { err = -EINVAL ; goto restore_opts; }
@@ -4337,8 +4323,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)set_task_ioprio (sbi->s_journal->j_task, journal_ioprio); } -if ((*flags &MS_RDONLY ) != (sb->s_flags &MS_RDONLY ) || - n_blocks_count >ext4_blocks_count (es)) { +if ((*flags &MS_RDONLY ) != (sb->s_flags &MS_RDONLY )) {if (sbi->s_mount_flags &EXT4_MF_FS_ABORTED ) { err = -EROFS ; goto restore_opts;
@@ -4413,8 +4398,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)if (sbi->s_journal)ext4_clear_journal_err (sb, es); sbi->s_mount_state =le16_to_cpu (es->s_state); -if ((err =ext4_group_extend (sb, es, n_blocks_count))) - goto restore_opts;if (!ext4_setup_super (sb, es,0 )) sb->s_flags &= ~MS_RDONLY ; if (EXT4_HAS_INCOMPAT_FEATURE(sb,
Re: [PATCH 2/2 V2] ext4: remove the resize mount option
Quoted 2 lines · Eric Sandeen
The resize mount option seems to be of limited value, especially in the age of online resize2fs. Nuke it.
I agree that it is useless today. That said, with the new online resize support that Yongqiang Yang is working on, it would again be possible to just do "remount -o resize={any larger size}" and it would work without the need for an ioctl or special user tool.
That might be useful in initrd/appliance kind of environments that put a premium on userspace tools. I don't run such an environment, but I've read many times about distro installs that want to do an image install to the disk and then resize it. Maybe in the age of DVDs and 4GB memory sticks this isn't needed anymore?
I'm not dead set on keeping it, just pointing out that it might again become useful in the same release that this patch lands in.
Cheers, Andreas
Quoted 122 lines
Documentation/filesystems/ext4.txt| 5 -----fs/ext4/super.c| 29 ++++++-----------------------2 files changed, 6 insertions(+), 28 deletions(-)Documentation/filesystems/ext4.txt +0
-5@@ -362,11 +362,6 @@ nouid32 Disables 32-bit UIDs and GIDs. This is for interoperability with older kernels which only store and expect 16-bit values. -resize Allows to resize filesystem to the end of the last - existing block group, further resize has to be done - with resize2fs either online, or offline. It can be - used only with conjunction with remount. -
block_validityThis options allows to enables/disables the in-kernelnoblock_validityfacility for tracking filesystem metadata blocks
within internal data structures. This allows multi-fs/ext4/super.c +6
-23@@ -1312,7 +1312,7 @@ enum { Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota, Opt_noquota, Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err, - Opt_resize, Opt_usrquota, Opt_grpquota, Opt_i_version, + Opt_usrquota, Opt_grpquota, Opt_i_version, Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit, Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, Opt_inode_readahead_blks, Opt_journal_ioprio,@@ -1374,7 +1374,6 @@ static const match_table_t tokens = { {Opt_nobarrier, "nobarrier"}, {Opt_i_version, "i_version"}, {Opt_stripe, "stripe=%u"}, - {Opt_resize, "resize"}, {Opt_delalloc, "delalloc"}, {Opt_nodelalloc, "nodelalloc"}, {Opt_mblk_io_submit, "mblk_io_submit"},@@ -1484,7 +1483,7 @@ static int clear_qf_name(struct super_block *sb, int qtype)static int parse_options (char *options,struct super_block *sb,unsigned long *journal_devnum,unsigned int *journal_ioprio, -ext4_fsblk_t *n_blocks_count,int is_remount) +int is_remount) {struct ext4_sb_info *sbi =EXT4_SB (sb);char *p;@@ -1761,17 +1760,6 @@ set_qf_format:break ;case Opt_ignore:break ; -case Opt_resize: -if (!is_remount) { -ext4_msg (sb,KERN_ERR , -"resize option only available " -"for remount" ); -return 0 ; - } -if (match_int (&args[0 ], &option) !=0 ) -return 0 ; - *n_blocks_count = option; -break ;case Opt_nobh:ext4_msg (sb,KERN_WARNING ,"Ignoring deprecated nobh option" );@@ -3200,13 +3188,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_li_wait_mult =EXT4_DEF_LI_WAIT_MULT ;if (!parse_options ((char *) sbi->s_es->s_mount_opts, sb, - &journal_devnum, &journal_ioprio,NULL ,0 )) { + &journal_devnum, &journal_ioprio,0 )) {ext4_msg (sb,KERN_WARNING ,"failed to parse options in superblock: %s" , sbi->s_es->s_mount_opts); }if (!parse_options ((char *) data, sb, &journal_devnum, - &journal_ioprio,NULL ,0 )) + &journal_ioprio,0 )) goto failed_mount; sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |@@ -4285,7 +4273,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) {struct ext4_super_block *es;struct ext4_sb_info *sbi =EXT4_SB (sb); -ext4_fsblk_t n_blocks_count =0 ;unsigned long old_sb_flags;struct ext4_mount_options old_opts;int enable_quota =0 ;@@ -4318,8 +4305,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)/* * Allow the "check" option to be passed as a remount option. */ -if (!parse_options (data, sb,NULL , &journal_ioprio, - &n_blocks_count,1 )) { +if (!parse_options (data, sb,NULL , &journal_ioprio,1 )) { err = -EINVAL ; goto restore_opts; }@@ -4337,8 +4323,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)set_task_ioprio (sbi->s_journal->j_task, journal_ioprio); } -if ((*flags &MS_RDONLY ) != (sb->s_flags &MS_RDONLY ) || - n_blocks_count >ext4_blocks_count (es)) { +if ((*flags &MS_RDONLY ) != (sb->s_flags &MS_RDONLY )) {if (sbi->s_mount_flags &EXT4_MF_FS_ABORTED ) { err = -EROFS ; goto restore_opts;@@ -4413,8 +4398,6 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)if (sbi->s_journal)ext4_clear_journal_err (sb, es); sbi->s_mount_state =le16_to_cpu (es->s_state); -if ((err =ext4_group_extend (sb, es, n_blocks_count))) - goto restore_opts;if (!ext4_setup_super (sb, es,0 )) sb->s_flags &= ~MS_RDONLY ; if (EXT4_HAS_INCOMPAT_FEATURE(sb,
Re: [PATCH 2/2 V2] ext4: remove the resize mount option
Quoted 15 lines · Andreas Dilger
Quoted 2 lines · Eric Sandeen
The resize mount option seems to be of limited value, especially in the age of online resize2fs. Nuke it.
I agree that it is useless today. That said, with the new online resize support that Yongqiang Yang is working on, it would again be possible to just do "remount -o resize={any larger size}" and it would work without the need for an ioctl or special user tool.
That might be useful in initrd/appliance kind of environments that put a premium on userspace tools. I don't run such an environment, but I've read many times about distro installs that want to do an image install to the disk and then resize it. Maybe in the age of DVDs and 4GB memory sticks this isn't needed anymore?
Quoted 4 lines
I'm not dead set on keeping it, just pointing out that it might again become useful in the same release that this patch lands in.
Cheers, Andreas
Hm. Well, just because it -can- be done ... should it be done? We could do all sorts of things via mount options if we really wanted to. mount -o tune2fs=^journal, you name it.
I don't have a super-strong preference either way, but we do have a tool for this already, so duplicating it in a mount option seems odd to me.
Thanks,
-Eric
Ted Ts'o
maintainerRe: [PATCH 2/2 V2] ext4: remove the resize mount option
Quoted 4 lines · Eric Sandeen
Hm. Well, just because it -can- be done ... should it be done? We could do all sorts of things via mount options if we really wanted to. mount -o tune2fs=^journal, you name it.
I tend to side with Eric that it seems to be an unnecessary complication. At the very least, if we were going to keep it, there would have to be an xfstests for it, since I'm fairly certain "mount -o resize=NNN" would be rarely, if ever, tested.
- Ted
Re: [PATCH 2/2 V2] ext4: remove the resize mount option
In reply to Eric SandeenQuoted 4 lines · Eric Sandeen
The resize mount option seems to be of limited value, especially in the age of online resize2fs. Nuke it.
Signed-off-by Eric Sandeen <[email protected]>
Applied, thanks.
- Ted