]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: correctly flush compressed data before/after direct IO
authorFilipe Manana <fdmanana@suse.com>
Thu, 9 Oct 2014 20:18:55 +0000 (21:18 +0100)
committerChris Mason <clm@fb.com>
Fri, 21 Nov 2014 01:14:27 +0000 (17:14 -0800)
commitbda1fd04c10e3cdde5709df96a5df4aa9a27423c
tree7a8cee33816ea7de60795f985068a176340e660d
parent68e99b6c096d15c5482ca5c8b39164e0b6641a5c
Btrfs: correctly flush compressed data before/after direct IO

For compressed writes, after doing the first filemap_fdatawrite_range() we
don't get the pages tagged for writeback immediately. Instead we create
a workqueue task, which is run by other kthread, and keep the pages locked.
That other kthread compresses data, creates the respective ordered extent/s,
tags the pages for writeback and unlocks them. Therefore we need a second
call to filemap_fdatawrite_range() if we have compressed writes, as this
second call will wait for the pages to become unlocked, then see they became
tagged for writeback and finally wait for the writeback to finish.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/file.c
fs/btrfs/inode.c