diff options
author | Jan Kara <jack@suse.cz> | 2010-03-24 20:18:37 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-03-24 20:18:37 -0400 |
commit | ba69f9ab7df844125898104e854e063b47c26637 (patch) | |
tree | d986b7fd25251f703d1f030f9eaa072b2daf55f2 /fs/ext4/super.c | |
parent | 37f328eb60a94779dd020084209fc4db2d6444a0 (diff) |
ext4: Don't use delayed allocation by default when used instead of ext3
When ext4 driver is used to mount a filesystem instead of the ext3 file
system driver (through CONFIG_EXT4_USE_FOR_EXT23), do not enable delayed
allocation by default since some ext3 users and application writers have
developed unfortunate expectations about the safety of writing files on
systems subject to sudden and violent death without using fsync().
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f4b038f51f31..29c6875d9b4d 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -68,7 +68,21 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf); | |||
68 | static int ext4_unfreeze(struct super_block *sb); | 68 | static int ext4_unfreeze(struct super_block *sb); |
69 | static void ext4_write_super(struct super_block *sb); | 69 | static void ext4_write_super(struct super_block *sb); |
70 | static int ext4_freeze(struct super_block *sb); | 70 | static int ext4_freeze(struct super_block *sb); |
71 | static int ext4_get_sb(struct file_system_type *fs_type, int flags, | ||
72 | const char *dev_name, void *data, struct vfsmount *mnt); | ||
71 | 73 | ||
74 | #if !defined(CONFIG_EXT3_FS) && !defined(CONFIG_EXT3_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT23) | ||
75 | static struct file_system_type ext3_fs_type = { | ||
76 | .owner = THIS_MODULE, | ||
77 | .name = "ext3", | ||
78 | .get_sb = ext4_get_sb, | ||
79 | .kill_sb = kill_block_super, | ||
80 | .fs_flags = FS_REQUIRES_DEV, | ||
81 | }; | ||
82 | #define IS_EXT3_SB(sb) ((sb)->s_bdev->bd_holder == &ext3_fs_type) | ||
83 | #else | ||
84 | #define IS_EXT3_SB(sb) (0) | ||
85 | #endif | ||
72 | 86 | ||
73 | ext4_fsblk_t ext4_block_bitmap(struct super_block *sb, | 87 | ext4_fsblk_t ext4_block_bitmap(struct super_block *sb, |
74 | struct ext4_group_desc *bg) | 88 | struct ext4_group_desc *bg) |
@@ -2539,7 +2553,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
2539 | * enable delayed allocation by default | 2553 | * enable delayed allocation by default |
2540 | * Use -o nodelalloc to turn it off | 2554 | * Use -o nodelalloc to turn it off |
2541 | */ | 2555 | */ |
2542 | set_opt(sbi->s_mount_opt, DELALLOC); | 2556 | if (!IS_EXT3_SB(sb)) |
2557 | set_opt(sbi->s_mount_opt, DELALLOC); | ||
2543 | 2558 | ||
2544 | if (!parse_options((char *) data, sb, &journal_devnum, | 2559 | if (!parse_options((char *) data, sb, &journal_devnum, |
2545 | &journal_ioprio, NULL, 0)) | 2560 | &journal_ioprio, NULL, 0)) |
@@ -4096,14 +4111,6 @@ static inline void unregister_as_ext2(void) { } | |||
4096 | #endif | 4111 | #endif |
4097 | 4112 | ||
4098 | #if !defined(CONFIG_EXT3_FS) && !defined(CONFIG_EXT3_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT23) | 4113 | #if !defined(CONFIG_EXT3_FS) && !defined(CONFIG_EXT3_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT23) |
4099 | static struct file_system_type ext3_fs_type = { | ||
4100 | .owner = THIS_MODULE, | ||
4101 | .name = "ext3", | ||
4102 | .get_sb = ext4_get_sb, | ||
4103 | .kill_sb = kill_block_super, | ||
4104 | .fs_flags = FS_REQUIRES_DEV, | ||
4105 | }; | ||
4106 | |||
4107 | static inline void register_as_ext3(void) | 4114 | static inline void register_as_ext3(void) |
4108 | { | 4115 | { |
4109 | int err = register_filesystem(&ext3_fs_type); | 4116 | int err = register_filesystem(&ext3_fs_type); |