From: Li Zefan <lizf@cn.fujitsu.com>
To: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: [PATCH v2] Btrfs: reserve enough space for file clone
Date: Fri, 29 Jul 2011 16:07:36 +0800 [thread overview]
Message-ID: <4E326A48.107@cn.fujitsu.com> (raw)
In-Reply-To: <4E32475E.2080404@cn.fujitsu.com>
# 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 <lizf@cn.fujitsu.com>
---
v2:
- fix typo: s/reverse/reserve
---
fs/btrfs/ioctl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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;
-- 1.7.3.1 --
next prev parent reply other threads:[~2011-07-29 8:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-29 5:38 [PATCH] Btrfs: reverse enough space for file clone Li Zefan
2011-07-29 8:07 ` Li Zefan [this message]
2011-07-29 9:32 ` [PATCH v2] Btrfs: reserve " Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E326A48.107@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.