All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: reverse enough space for file clone
@ 2011-07-29  5:38 Li Zefan
  2011-07-29  8:07 ` [PATCH v2] Btrfs: reserve " Li Zefan
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zefan @ 2011-07-29  5:38 UTC (permalink / raw)
  To: linux-btrfs

  # 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 reverse space for both file extent item insertion and
inode update.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] Btrfs: reserve enough space for file clone
  2011-07-29  5:38 [PATCH] Btrfs: reverse enough space for file clone Li Zefan
@ 2011-07-29  8:07 ` Li Zefan
  2011-07-29  9:32   ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zefan @ 2011-07-29  8:07 UTC (permalink / raw)
  To: linux-btrfs

  # 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 --

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Btrfs: reserve enough space for file clone
  2011-07-29  8:07 ` [PATCH v2] Btrfs: reserve " Li Zefan
@ 2011-07-29  9:32   ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2011-07-29  9:32 UTC (permalink / raw)
  To: Li Zefan; +Cc: linux-btrfs

On Fri, Jul 29, 2011 at 04:07:36PM +0800, Li Zefan wrote:
>   # 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!

Sounds like a regression test you should add to xfstests.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-29  9:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-29  5:38 [PATCH] Btrfs: reverse enough space for file clone Li Zefan
2011-07-29  8:07 ` [PATCH v2] Btrfs: reserve " Li Zefan
2011-07-29  9:32   ` Christoph Hellwig

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.