From patchwork Fri Jul 29 08:07:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zefan X-Patchwork-Id: 1019212 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6T87lVa010316 for ; Fri, 29 Jul 2011 08:07:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755379Ab1G2IHn (ORCPT ); Fri, 29 Jul 2011 04:07:43 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:64073 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754352Ab1G2IHk (ORCPT ); Fri, 29 Jul 2011 04:07:40 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id D89B6170028 for ; Fri, 29 Jul 2011 16:07:32 +0800 (CST) Received: from mailserver.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id p6T87VLr031158 for ; Fri, 29 Jul 2011 16:07:32 +0800 Received: from [10.167.225.230] ([10.167.225.230]) by mailserver.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2011072916063558-53377 ; Fri, 29 Jul 2011 16:06:35 +0800 Message-ID: <4E326A48.107@cn.fujitsu.com> Date: Fri, 29 Jul 2011 16:07:36 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc14 Thunderbird/3.1.4 MIME-Version: 1.0 To: "linux-btrfs@vger.kernel.org" Subject: [PATCH v2] Btrfs: reserve enough space for file clone References: <4E32475E.2080404@cn.fujitsu.com> In-Reply-To: <4E32475E.2080404@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-07-29 16:06:35, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-07-29 16:06:36, Serialize complete at 2011-07-29 16:06:36 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.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Jul 2011 08:07:47 +0000 (UTC) # mount -t btrfs /dev/sda7 /mnt # dd if=/dev/zero of=/mnt/src bs=10K count=1 # sync # clone 4K from /mnt/src to /mnt/dst kernel BUG at fs/btrfs/delayed-inode.c:1693! We should reserve space for both file extent item insertion and inode update. Signed-off-by: Li Zefan --- v2: - fix typo: s/reverse/reserve --- fs/btrfs/ioctl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- 1.7.3.1 -- -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 0b980af..05af14c 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2314,7 +2314,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, else new_key.offset = destoff; - trans = btrfs_start_transaction(root, 1); + trans = btrfs_start_transaction(root, 2); if (IS_ERR(trans)) { ret = PTR_ERR(trans); goto out;