• Dmitry Monakhov's avatar
    ext4: fix unwritten counter leakage · 82e54229
    Dmitry Monakhov authored
    ext4_set_io_unwritten_flag() will increment i_unwritten counter, so
    once we mark end_io with EXT4_END_IO_UNWRITTEN we have to revert it back
    on error path.
    
     - add missed error checks to prevent counter leakage
     - ext4_end_io_nolock() will clear EXT4_END_IO_UNWRITTEN flag to signal
       that conversion finished.
     - add BUG_ON to ext4_free_end_io() to prevent similar leakage in future.
    
    Visible effect of this bug is that unaligned aio_stress may deadlock
    Reviewed-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    82e54229
extents.c 134 KB