Skip to content

Commit

Permalink
ext3: make default data ordering mode configurable
Browse files Browse the repository at this point in the history
This makes the defautl ext3 data ordering mode (when no explicit
ordering is set) configurable, so as to allow people to default to
'data=writeback' and get the resulting latency improvements.

This is a non-issue if a filesystem has been explicitly set to some
ordering (with 'tune2fs').

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
torvalds committed Apr 7, 2009
1 parent e0724bf commit bbae8bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
19 changes: 19 additions & 0 deletions fs/ext3/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ config EXT3_FS
To compile this file system support as a module, choose M here: the
module will be called ext3.

config EXT3_DEFAULTS_TO_ORDERED
bool "Default to 'data=ordered' in ext3 (legacy option)"
depends on EXT3_FS
help
If a filesystem does not explicitly specify a data ordering
mode, and the journal capability allowed it, ext3 used to
historically default to 'data=ordered'.

That was a rather unfortunate choice, because it leads to all
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
want to use 'data=ordered' mode, set it in the filesystem itself
with 'tune2fs -o journal_data_ordered'.

But if you really want to enable the legacy default, you can do
so by answering 'y' to this question.

config EXT3_FS_XATTR
bool "Ext3 extended attributes"
depends on EXT3_FS
Expand Down
8 changes: 7 additions & 1 deletion fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
#include "acl.h"
#include "namei.h"

#ifdef CONFIG_EXT3_DEFAULTS_TO_ORDERED
#define EXT3_MOUNT_DEFAULT_DATA_MODE EXT3_MOUNT_ORDERED_DATA
#else
#define EXT3_MOUNT_DEFAULT_DATA_MODE EXT3_MOUNT_WRITEBACK_DATA
#endif

static int ext3_load_journal(struct super_block *, struct ext3_super_block *,
unsigned long journal_devnum);
static int ext3_create_journal(struct super_block *, struct ext3_super_block *,
Expand Down Expand Up @@ -1919,7 +1925,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
cope, else JOURNAL_DATA */
if (journal_check_available_features
(sbi->s_journal, 0, 0, JFS_FEATURE_INCOMPAT_REVOKE))
set_opt(sbi->s_mount_opt, ORDERED_DATA);
set_opt(sbi->s_mount_opt, DEFAULT_DATA_MODE);
else
set_opt(sbi->s_mount_opt, JOURNAL_DATA);
break;
Expand Down

0 comments on commit bbae8bc

Please sign in to comment.