aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-03-21 22:29:15 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-03-21 22:29:15 -0400
commita8e25a83245618e6b0ddf82a9bba79c1b466804d (patch)
tree0bcdefe7f23b4fba9a9b20e02cec08d0550de316 /fs/ext4
parent1b8b9750f07cdd6e13f12c06ae7ec853f2abbe6c (diff)
ext4: write superblock only once on unmount
In some rather rare cases it is possible that ext4 may the superblock to the media twice. This patch makes sure this does not happen. This should speed up unmounting in those cases. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 1e26f4a0b555..626c1f840118 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -836,9 +836,6 @@ static void ext4_put_super(struct super_block *sb)
836 destroy_workqueue(sbi->dio_unwritten_wq); 836 destroy_workqueue(sbi->dio_unwritten_wq);
837 837
838 lock_super(sb); 838 lock_super(sb);
839 if (sb->s_dirt)
840 ext4_commit_super(sb, 1);
841
842 if (sbi->s_journal) { 839 if (sbi->s_journal) {
843 err = jbd2_journal_destroy(sbi->s_journal); 840 err = jbd2_journal_destroy(sbi->s_journal);
844 sbi->s_journal = NULL; 841 sbi->s_journal = NULL;
@@ -855,8 +852,10 @@ static void ext4_put_super(struct super_block *sb)
855 if (!(sb->s_flags & MS_RDONLY)) { 852 if (!(sb->s_flags & MS_RDONLY)) {
856 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 853 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
857 es->s_state = cpu_to_le16(sbi->s_mount_state); 854 es->s_state = cpu_to_le16(sbi->s_mount_state);
858 ext4_commit_super(sb, 1);
859 } 855 }
856 if (sb->s_dirt || !(sb->s_flags & MS_RDONLY))
857 ext4_commit_super(sb, 1);
858
860 if (sbi->s_proc) { 859 if (sbi->s_proc) {
861 remove_proc_entry("options", sbi->s_proc); 860 remove_proc_entry("options", sbi->s_proc);
862 remove_proc_entry(sb->s_id, ext4_proc_root); 861 remove_proc_entry(sb->s_id, ext4_proc_root);