Commit e9cab24c authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
  ext3: Improve error message that changing journaling mode on remount is not possible
  ext3: Update Kconfig description of EXT3_DEFAULTS_TO_ORDERED
parents a206e941 3c4cec65
...@@ -29,23 +29,25 @@ config EXT3_FS ...@@ -29,23 +29,25 @@ config EXT3_FS
module will be called ext3. module will be called ext3.
config EXT3_DEFAULTS_TO_ORDERED config EXT3_DEFAULTS_TO_ORDERED
bool "Default to 'data=ordered' in ext3 (legacy option)" bool "Default to 'data=ordered' in ext3"
depends on EXT3_FS depends on EXT3_FS
help help
If a filesystem does not explicitly specify a data ordering The journal mode options for ext3 have different tradeoffs
mode, and the journal capability allowed it, ext3 used to between when data is guaranteed to be on disk and
historically default to 'data=ordered'. performance. The use of "data=writeback" can cause
unwritten data to appear in files after an system crash or
That was a rather unfortunate choice, because it leads to all power failure, which can be a security issue. However,
kinds of latency problems, and the 'data=writeback' mode is more "data=ordered" mode can also result in major performance
appropriate these days. problems, including seconds-long delays before an fsync()
call returns. For details, see:
You should probably always answer 'n' here, and if you really
want to use 'data=ordered' mode, set it in the filesystem itself http://ext4.wiki.kernel.org/index.php/Ext3_data_mode_tradeoffs
with 'tune2fs -o journal_data_ordered'.
If you have been historically happy with ext3's performance,
But if you really want to enable the legacy default, you can do data=ordered mode will be a safe choice and you should
so by answering 'y' to this question. answer 'y' here. If you understand the reliability and data
privacy issues of data=writeback and are willing to make
that trade off, answer 'n'.
config EXT3_FS_XATTR config EXT3_FS_XATTR
bool "Ext3 extended attributes" bool "Ext3 extended attributes"
......
...@@ -543,6 +543,19 @@ static inline void ext3_show_quota_options(struct seq_file *seq, struct super_bl ...@@ -543,6 +543,19 @@ static inline void ext3_show_quota_options(struct seq_file *seq, struct super_bl
#endif #endif
} }
static char *data_mode_string(unsigned long mode)
{
switch (mode) {
case EXT3_MOUNT_JOURNAL_DATA:
return "journal";
case EXT3_MOUNT_ORDERED_DATA:
return "ordered";
case EXT3_MOUNT_WRITEBACK_DATA:
return "writeback";
}
return "unknown";
}
/* /*
* Show an option if * Show an option if
* - it's set to a non-default value OR * - it's set to a non-default value OR
...@@ -616,13 +629,8 @@ static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs) ...@@ -616,13 +629,8 @@ static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
if (test_opt(sb, NOBH)) if (test_opt(sb, NOBH))
seq_puts(seq, ",nobh"); seq_puts(seq, ",nobh");
if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA) seq_printf(seq, ",data=%s", data_mode_string(sbi->s_mount_opt &
seq_puts(seq, ",data=journal"); EXT3_MOUNT_DATA_FLAGS));
else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)
seq_puts(seq, ",data=ordered");
else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
seq_puts(seq, ",data=writeback");
if (test_opt(sb, DATA_ERR_ABORT)) if (test_opt(sb, DATA_ERR_ABORT))
seq_puts(seq, ",data_err=abort"); seq_puts(seq, ",data_err=abort");
...@@ -1024,12 +1032,18 @@ static int parse_options (char *options, struct super_block *sb, ...@@ -1024,12 +1032,18 @@ static int parse_options (char *options, struct super_block *sb,
datacheck: datacheck:
if (is_remount) { if (is_remount) {
if ((sbi->s_mount_opt & EXT3_MOUNT_DATA_FLAGS) if ((sbi->s_mount_opt & EXT3_MOUNT_DATA_FLAGS)
!= data_opt) { == data_opt)
printk(KERN_ERR break;
"EXT3-fs: cannot change data " printk(KERN_ERR
"mode on remount\n"); "EXT3-fs (device %s): Cannot change "
return 0; "data mode on remount. The filesystem "
} "is mounted in data=%s mode and you "
"try to remount it in data=%s mode.\n",
sb->s_id,
data_mode_string(sbi->s_mount_opt &
EXT3_MOUNT_DATA_FLAGS),
data_mode_string(data_opt));
return 0;
} else { } else {
sbi->s_mount_opt &= ~EXT3_MOUNT_DATA_FLAGS; sbi->s_mount_opt &= ~EXT3_MOUNT_DATA_FLAGS;
sbi->s_mount_opt |= data_opt; sbi->s_mount_opt |= data_opt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment