diff options
author | Yan, Zheng <zheng.z.yan@linux.intel.com> | 2010-12-06 02:02:36 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-12-10 16:29:09 -0500 |
commit | 24ae63656a165c870c0d69fcc8aac1dc35e25e34 (patch) | |
tree | 8833bfeba51ef45e0acc42f3a23838f528e6a37e /fs | |
parent | 84cd948cb11041f205242de457e680b9bb872a36 (diff) |
Btrfs: Fix page leak in compressed writeback path
"start + num_bytes >= actual_end" can happen when compressed page writeback races
with file truncation. In that case we need unlock and release pages past the end
of file.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ae6c0d190bc1..4875d69871b5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -495,7 +495,7 @@ again: | |||
495 | add_async_extent(async_cow, start, num_bytes, | 495 | add_async_extent(async_cow, start, num_bytes, |
496 | total_compressed, pages, nr_pages_ret); | 496 | total_compressed, pages, nr_pages_ret); |
497 | 497 | ||
498 | if (start + num_bytes < end && start + num_bytes < actual_end) { | 498 | if (start + num_bytes < end) { |
499 | start += num_bytes; | 499 | start += num_bytes; |
500 | pages = NULL; | 500 | pages = NULL; |
501 | cond_resched(); | 501 | cond_resched(); |