From patchwork Mon Dec 6 07:02:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 377082 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB672qo5021562 for ; Mon, 6 Dec 2010 07:02:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751023Ab0LFHCi (ORCPT ); Mon, 6 Dec 2010 02:02:38 -0500 Received: from mga09.intel.com ([134.134.136.24]:51542 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804Ab0LFHCi (ORCPT ); Mon, 6 Dec 2010 02:02:38 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 05 Dec 2010 23:02:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.59,305,1288594800"; d="scan'208";a="580888605" Received: from unknown (HELO [10.239.36.4]) ([10.239.36.4]) by orsmga002.jf.intel.com with ESMTP; 05 Dec 2010 23:02:36 -0800 Message-ID: <4CFC8A8C.6010203@linux.intel.com> Date: Mon, 06 Dec 2010 15:02:36 +0800 From: "Yan, Zheng" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Thunderbird/3.1.6 MIME-Version: 1.0 To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: Fix page leak in compressed writeback path Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 06 Dec 2010 07:02:53 +0000 (UTC) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8039390..2ea98d8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -495,7 +495,7 @@ again: add_async_extent(async_cow, start, num_bytes, total_compressed, pages, nr_pages_ret); - if (start + num_bytes < end && start + num_bytes < actual_end) { + if (start + num_bytes < end) { start += num_bytes; pages = NULL; cond_resched();