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
This commit is contained in:
Linus Torvalds 2009-08-25 09:47:36 -07:00
commit e9cab24cf3
2 changed files with 42 additions and 26 deletions

View file

@ -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
power failure, which can be a security issue. However,
"data=ordered" mode can also result in major performance
problems, including seconds-long delays before an fsync()
call returns. For details, see:
That was a rather unfortunate choice, because it leads to all http://ext4.wiki.kernel.org/index.php/Ext3_data_mode_tradeoffs
kinds of latency problems, and the 'data=writeback' mode is more
appropriate these days.
You should probably always answer 'n' here, and if you really If you have been historically happy with ext3's performance,
want to use 'data=ordered' mode, set it in the filesystem itself data=ordered mode will be a safe choice and you should
with 'tune2fs -o journal_data_ordered'. answer 'y' here. If you understand the reliability and data
privacy issues of data=writeback and are willing to make
But if you really want to enable the legacy default, you can do that trade off, answer 'n'.
so by answering 'y' to this question.
config EXT3_FS_XATTR config EXT3_FS_XATTR
bool "Ext3 extended attributes" bool "Ext3 extended attributes"

View file

@ -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)
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,
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)
break;
printk(KERN_ERR printk(KERN_ERR
"EXT3-fs: cannot change data " "EXT3-fs (device %s): Cannot change "
"mode on remount\n"); "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; 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;