diff options
author | Chris Mason <chris.mason@fusionio.com> | 2013-03-26 13:07:00 -0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-04-25 20:25:44 +0100 |
commit | e6742b3695b04303938c572261dd0b0e7e38396c (patch) | |
tree | 0f9034c089070e8551f1d53afb6ff279532efb9a /fs/efs | |
parent | 40e5c2b17933a25380494548391126affae73c58 (diff) |
Btrfs: fix race between mmap writes and compression
commit 4adaa611020fa6ac65b0ac8db78276af4ec04e63 upstream.
Btrfs uses page_mkwrite to ensure stable pages during
crc calculations and mmap workloads. We call clear_page_dirty_for_io
before we do any crcs, and this forces any application with the file
mapped to wait for the crc to finish before it is allowed to change
the file.
With compression on, the clear_page_dirty_for_io step is happening after
we've compressed the pages. This means the applications might be
changing the pages while we are compressing them, and some of those
modifications might not hit the disk.
This commit adds the clear_page_dirty_for_io before compression starts
and makes sure to redirty the page if we have to fallback to
uncompressed IO as well.
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Reported-by: Alexandre Oliva <oliva@gnu.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs/efs')
0 files changed, 0 insertions, 0 deletions