Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1354102 > unrolled thread
| Started by | Ales Novak <alnovak@suse.cz> |
|---|---|
| First post | 2016-03-09 14:20 +0100 |
| Last post | 2016-03-13 04:00 +0100 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] fix: print ext4 mountopt data_err=abort correctly Ales Novak <alnovak@suse.cz> - 2016-03-09 14:20 +0100
(none) Ales Novak <alnovak@suse.cz> - 2016-03-09 19:40 +0100
[PATCH] fix: print ext4 mountopt data_err=abort correctly Ales Novak <alnovak@suse.cz> - 2016-03-09 19:40 +0100
Re: [PATCH] fix: print ext4 mountopt data_err=abort correctly Theodore Ts'o <tytso@mit.edu> - 2016-03-13 04:00 +0100
| From | Ales Novak <alnovak@suse.cz> |
|---|---|
| Date | 2016-03-09 14:20 +0100 |
| Subject | [PATCH] fix: print ext4 mountopt data_err=abort correctly |
| Message-ID | <raMbU-8oX-17@gated-at.bofh.it> |
If data_err=abort option is specified for an ext3/ext4 mount,
/proc/mounts does show it as "(null)". This is caused by token2str()
returning NULL for Opt_data_err_abort (due to its pattern containing
'=').
This could be solved by many ways, this one is the conservative and
former ext3 way resembling.
Signed-off-by: Ales Novak <alnovak@suse.cz>
---
fs/ext4/super.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3ed01ec..58c203a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1860,7 +1860,8 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
for (m = ext4_mount_opts; m->token != Opt_err; m++) {
int want_set = m->flags & MOPT_SET;
if (((m->flags & (MOPT_SET|MOPT_CLEAR)) == 0) ||
- (m->flags & MOPT_CLEAR_ERR))
+ (m->flags & MOPT_CLEAR_ERR) ||
+ (m->mount_opt & EXT4_MOUNT_DATA_ERR_ABORT))
continue;
if (!(m->mount_opt & (sbi->s_mount_opt ^ def_mount_opt)))
continue; /* skip if same as the default */
@@ -1914,6 +1915,8 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
SEQ_OPTS_PRINT("init_itable=%u", sbi->s_li_wait_mult);
if (nodefs || sbi->s_max_dir_size_kb)
SEQ_OPTS_PRINT("max_dir_size_kb=%u", sbi->s_max_dir_size_kb);
+ if (test_opt(sb, DATA_ERR_ABORT))
+ SEQ_OPTS_PUTS("data_err=abort");
ext4_show_quota_options(seq, sb);
return 0;
--
2.7.0
[toc] | [next] | [standalone]
| From | Ales Novak <alnovak@suse.cz> |
|---|---|
| Date | 2016-03-09 19:40 +0100 |
| Subject | (none) |
| Message-ID | <raRbA-3t4-11@gated-at.bofh.it> |
| In reply to | #1354102 |
This is alternative patch to the previous one, taking maybe more logical approach.
[toc] | [prev] | [next] | [standalone]
| From | Ales Novak <alnovak@suse.cz> |
|---|---|
| Date | 2016-03-09 19:40 +0100 |
| Message-ID | <raRbA-3t4-21@gated-at.bofh.it> |
| In reply to | #1354337 |
If data_err=abort option is specified for an ext3/ext4 mount,
/proc/mounts does show it as "(null)". This is caused by token2str()
returning NULL for Opt_data_err_abort (due to its pattern containing
'=').
This is perhaps more logical solution than the previously submitted,
handling these 'data_err=' options in other way than MOPT_SET.
Signed-off-by: Ales Novak <alnovak@suse.cz>
---
fs/ext4/super.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3ed01ec..19e589c 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1425,9 +1425,9 @@ static const struct mount_opts {
{Opt_err_ro, EXT4_MOUNT_ERRORS_RO, MOPT_SET | MOPT_CLEAR_ERR},
{Opt_err_cont, EXT4_MOUNT_ERRORS_CONT, MOPT_SET | MOPT_CLEAR_ERR},
{Opt_data_err_abort, EXT4_MOUNT_DATA_ERR_ABORT,
- MOPT_NO_EXT2 | MOPT_SET},
+ MOPT_NO_EXT2},
{Opt_data_err_ignore, EXT4_MOUNT_DATA_ERR_ABORT,
- MOPT_NO_EXT2 | MOPT_CLEAR},
+ MOPT_NO_EXT2},
{Opt_barrier, EXT4_MOUNT_BARRIER, MOPT_SET},
{Opt_nobarrier, EXT4_MOUNT_BARRIER, MOPT_CLEAR},
{Opt_noauto_da_alloc, EXT4_MOUNT_NO_AUTO_DA_ALLOC, MOPT_SET},
@@ -1705,6 +1705,10 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
ext4_msg(sb, KERN_INFO, "dax option not supported");
return -1;
#endif
+ } else if (token == Opt_data_err_abort) {
+ sbi->s_mount_opt |= m->mount_opt;
+ } else if (token == Opt_data_err_ignore) {
+ sbi->s_mount_opt &= ~m->mount_opt;
} else {
if (!args->from)
arg = 1;
@@ -1914,6 +1918,8 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
SEQ_OPTS_PRINT("init_itable=%u", sbi->s_li_wait_mult);
if (nodefs || sbi->s_max_dir_size_kb)
SEQ_OPTS_PRINT("max_dir_size_kb=%u", sbi->s_max_dir_size_kb);
+ if (test_opt(sb, DATA_ERR_ABORT))
+ SEQ_OPTS_PUTS("data_err=abort");
ext4_show_quota_options(seq, sb);
return 0;
--
2.7.0
[toc] | [prev] | [next] | [standalone]
| From | Theodore Ts'o <tytso@mit.edu> |
|---|---|
| Date | 2016-03-13 04:00 +0100 |
| Message-ID | <rc4q6-7wy-3@gated-at.bofh.it> |
| In reply to | #1354338 |
On Wed, Mar 09, 2016 at 07:30:40PM +0100, Ales Novak wrote: > If data_err=abort option is specified for an ext3/ext4 mount, > /proc/mounts does show it as "(null)". This is caused by token2str() > returning NULL for Opt_data_err_abort (due to its pattern containing > '='). > > This is perhaps more logical solution than the previously submitted, > handling these 'data_err=' options in other way than MOPT_SET. > > Signed-off-by: Ales Novak <alnovak@suse.cz> Thanks, applied. - Ted
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web