]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ext4/super.c
ext4: fix ext4_flush_completed_IO wait semantics
[karo-tx-linux.git] / fs / ext4 / super.c
index b8de488889d6b256d82d18c6f057253d4158e6c9..982f6fc22c889ed28a182da483950d6e004708b8 100644 (file)
@@ -431,7 +431,7 @@ static void __save_error_info(struct super_block *sb, const char *func,
         */
        if (!es->s_error_count)
                mod_timer(&EXT4_SB(sb)->s_err_report, jiffies + 24*60*60*HZ);
-       es->s_error_count = cpu_to_le32(le32_to_cpu(es->s_error_count) + 1);
+       le32_add_cpu(&es->s_error_count, 1);
 }
 
 static void save_error_info(struct super_block *sb, const char *func,
@@ -965,11 +965,10 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
        ei->jinode = NULL;
        INIT_LIST_HEAD(&ei->i_completed_io_list);
        spin_lock_init(&ei->i_completed_io_lock);
-       ei->cur_aio_dio = NULL;
        ei->i_sync_tid = 0;
        ei->i_datasync_tid = 0;
        atomic_set(&ei->i_ioend_count, 0);
-       atomic_set(&ei->i_aiodio_unwritten, 0);
+       atomic_set(&ei->i_unwritten, 0);
 
        return &ei->vfs_inode;
 }
@@ -1749,7 +1748,7 @@ static inline void ext4_show_quota_options(struct seq_file *seq,
 
 static const char *token2str(int token)
 {
-       static const struct match_token *t;
+       const struct match_token *t;
 
        for (t = tokens; t->token != Opt_err; t++)
                if (t->token == token && !strchr(t->pattern, '='))
@@ -2177,10 +2176,12 @@ static void ext4_orphan_cleanup(struct super_block *sb,
        }
 
        if (EXT4_SB(sb)->s_mount_state & EXT4_ERROR_FS) {
-               if (es->s_last_orphan)
+               /* don't clear list on RO mount w/ errors */
+               if (es->s_last_orphan && !(s_flags & MS_RDONLY)) {
                        jbd_debug(1, "Errors on filesystem, "
                                  "clearing orphan list.\n");
-               es->s_last_orphan = 0;
+                       es->s_last_orphan = 0;
+               }
                jbd_debug(1, "Skipping orphan recovery on fs with errors.\n");
                return;
        }
@@ -2585,10 +2586,12 @@ static struct attribute *ext4_attrs[] = {
 /* Features this copy of ext4 supports */
 EXT4_INFO_ATTR(lazy_itable_init);
 EXT4_INFO_ATTR(batched_discard);
+EXT4_INFO_ATTR(meta_bg_resize);
 
 static struct attribute *ext4_feat_attrs[] = {
        ATTR_LIST(lazy_itable_init),
        ATTR_LIST(batched_discard),
+       ATTR_LIST(meta_bg_resize),
        NULL,
 };
 
@@ -3409,7 +3412,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
         * enable delayed allocation by default
         * Use -o nodelalloc to turn it off
         */
-       if (!IS_EXT3_SB(sb) &&
+       if (!IS_EXT3_SB(sb) && !IS_EXT2_SB(sb) &&
            ((def_mount_opts & EXT4_DEFM_NODELALLOC) == 0))
                set_opt(sb, DELALLOC);