Skip to contentSkip to conversation

Btrfs: reverse enough space for file clone

PATCH Superseded Li Zefan 2 participants 3 messages Jul 29, 2011 Btrfs file system

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 Btrfs: reverse enough space for file clone

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

---
 fs/btrfs/ioctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/ioctl.c +1 -1
index 0b980af..05af14c 100644
@@ -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;
Signature · 1 line
1.7.3.1
author
#1 lore raw

PATCH v2 1/1 Btrfs: reserve enough space for file clone

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

---

v2:

- fix typo: s/reverse/reserve

---
 fs/btrfs/ioctl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/ioctl.c +1 -1
index 0b980af..05af14c 100644
@@ -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 --

#2 lore raw

Re: [PATCH v2] Btrfs: reserve enough space for file clone

Quoted 6 lines · Li Zefan
  # 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.