]> Pileus Git - ~andy/linux/commit
ext4: defer clearing of PageWriteback after extent conversion
authorJan Kara <jack@suse.cz>
Tue, 4 Jun 2013 18:23:41 +0000 (14:23 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 4 Jun 2013 18:23:41 +0000 (14:23 -0400)
commitb0857d309faefaf5443752458e8af1a4b22b3e92
treeb6b18b3d41831a205a5f90609abb567fd756e07c
parent2e8fa54e3b48e4ce8c4e9ca4674ffbc973f58be5
ext4: defer clearing of PageWriteback after extent conversion

Currently PageWriteback bit gets cleared from put_io_page() called
from ext4_end_bio().  This is somewhat inconvenient as extent tree is
not fully updated at that time (unwritten extents are not marked as
written) so we cannot read the data back yet.  This design was
dictated by lock ordering as we cannot start a transaction while
PageWriteback bit is set (we could easily deadlock with
ext4_da_writepages()).  But now that we use transaction reservation
for extent conversion, locking issues are solved and we can move
PageWriteback bit clearing after extent conversion is done.  As a
result we can remove wait for unwritten extent conversion from
ext4_sync_file() because it already implicitely happens through
wait_on_page_writeback().

We implement deferring of PageWriteback clearing by queueing completed
bios to appropriate io_end and processing all the pages when io_end is
going to be freed instead of at the moment ext4_io_end() is called.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/fsync.c
fs/ext4/page-io.c