aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 7dd698107822..762e8037c888 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2678,8 +2678,15 @@ static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate)
2678 goto out; 2678 goto out;
2679 } 2679 }
2680 2680
2681 io_end->flag = EXT4_IO_END_UNWRITTEN; 2681 /*
2682 * It may be over-defensive here to check EXT4_IO_END_UNWRITTEN now,
2683 * but being more careful is always safe for the future change.
2684 */
2682 inode = io_end->inode; 2685 inode = io_end->inode;
2686 if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) {
2687 io_end->flag |= EXT4_IO_END_UNWRITTEN;
2688 atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten);
2689 }
2683 2690
2684 /* Add the io_end to per-inode completed io list*/ 2691 /* Add the io_end to per-inode completed io list*/
2685 spin_lock_irqsave(&EXT4_I(inode)->i_completed_io_lock, flags); 2692 spin_lock_irqsave(&EXT4_I(inode)->i_completed_io_lock, flags);