summaryrefslogtreecommitdiffstats
path: root/net/compat.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-03-26 18:07:00 +0100
committerChris Mason <chris.mason@fusionio.com>2013-03-26 18:19:14 +0100
commit4adaa611020fa6ac65b0ac8db78276af4ec04e63 (patch)
treeb478ee3f9a16714521f5ced528ff2ce7afd71b8e /net/compat.c
parentBtrfs: fix memory leak in btrfs_create_tree() (diff)
downloadlinux-4adaa611020fa6ac65b0ac8db78276af4ec04e63.tar.xz
linux-4adaa611020fa6ac65b0ac8db78276af4ec04e63.zip
Btrfs: fix race between mmap writes and compression
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> cc: stable@vger.kernel.org
Diffstat (limited to 'net/compat.c')
0 files changed, 0 insertions, 0 deletions