From patchwork Tue Oct 19 22:22:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 266591 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 o9JMMQlE007367 for ; Tue, 19 Oct 2010 22:22:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754018Ab0JSWWU (ORCPT ); Tue, 19 Oct 2010 18:22:20 -0400 Received: from cobra.newdream.net ([66.33.216.30]:48491 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754479Ab0JSWWT (ORCPT ); Tue, 19 Oct 2010 18:22:19 -0400 Received: from localhost.localdomain (dhcp-63-161.cse.ucsc.edu [128.114.63.161]) by cobra.newdream.net (Postfix) with ESMTPA id D7EA8BC75B; Tue, 19 Oct 2010 15:25:14 -0700 (PDT) From: Sage Weil To: linux-btrfs@vger.kernel.org Cc: Yehuda Sadeh Subject: [PATCH 2/3] Btrfs: fix clone ioctl where range is adjacent to extent Date: Tue, 19 Oct 2010 15:22:11 -0700 Message-Id: <1287526932-28369-3-git-send-email-sage@newdream.net> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1287526932-28369-1-git-send-email-sage@newdream.net> References: <1287526932-28369-1-git-send-email-sage@newdream.net> 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]); Tue, 19 Oct 2010 22:22:27 +0000 (UTC) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3471b22..f4a3dde 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1607,7 +1607,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, } btrfs_release_path(root, path); - if (key.offset + datal < off || + if (key.offset + datal <= off || key.offset >= off+len) goto next;