From patchwork Wed Sep 22 00:02:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yehuda Sadeh X-Patchwork-Id: 198272 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 o8M03C37024222 for ; Wed, 22 Sep 2010 00:03:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752147Ab0IVADK (ORCPT ); Tue, 21 Sep 2010 20:03:10 -0400 Received: from mail.hq.newdream.net ([66.33.206.127]:53765 "EHLO mail.hq.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751484Ab0IVADJ (ORCPT ); Tue, 21 Sep 2010 20:03:09 -0400 Received: from mail.hq.newdream.net (localhost [127.0.0.1]) by mail.hq.newdream.net (Postfix) with ESMTP id 6C08227D4A; Tue, 21 Sep 2010 17:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=hq.newdream.net; h=from:to :cc:subject:date:message-id:in-reply-to:references; s=drama; bh= pSHXLKb4M+3T5Thul18SpqotDYg=; b=HyaPvZSvRpsG1vmKA4Q3+LGv9YCYJon+ a1hJXlQD0seCZTQMV6Uq4L9rqIJkveh96nxx4TPrR3bvWACgexHtZlQVROpA+2zx jsk+a4VUiysmGl/GAG3/cllMxvDY6pwrVi01RbP0HKsUIlcCR8DoZZY9spXPm0JB woL+q+MXIt4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=hq.newdream.net; h=from:to :cc:subject:date:message-id:in-reply-to:references; q=dns; s= drama; b=V6/R8nmvYh14upC6Y2WCmMoqhb0Vl5lD1G9QAV9341yPc/AG9ZA/erW de2m0LGkiwO+HtyIZwMHUueLuyI/ZG2BPdlGCjEu/XrMP1JK/jeD00spla4kNfyW jE9GtMA0Iv9S310O8QBOFg/85oT1W79HGT0aufgkpY5puMmebEwI= Received: from localhost.localdomain (ip-66-33-206-8.dreamhost.com [66.33.206.8]) by mail.hq.newdream.net (Postfix) with ESMTP id 5DF1E27D42; Tue, 21 Sep 2010 17:03:09 -0700 (PDT) From: Yehuda Sadeh To: linux-btrfs@vger.kernel.org Cc: sage@newdream.net, Yehuda Sadeh Subject: [PATCH] Btrfs: fix clone ioctl where range is adjacent to extent Date: Tue, 21 Sep 2010 17:02:34 -0700 Message-Id: <5a425001257ed650ef26779a9ce419860fc163e9.1285113216.git.yehuda@hq.newdream.net> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <630121e7c17b2804bc24194e13469d5e58d51174.1285113216.git.yehuda@hq.newdream.net> References: <630121e7c17b2804bc24194e13469d5e58d51174.1285113216.git.yehuda@hq.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]); Wed, 22 Sep 2010 00:03:12 +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;