Skip to content

Commit e70bea5

Browse files
author
Josef Bacik
committed
Btrfs: fix the amount of space reserved for unlink
Our unlink reservations were a bit much, we were reserving 10 and I only count 8 possible items we're touching, so comment what we're reserving for and fix the count value. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
1 parent 4b91c14 commit e70bea5

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎fs/btrfs/inode.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2758,7 +2758,16 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir,
27582758
u64 ino = btrfs_ino(inode);
27592759
u64 dir_ino = btrfs_ino(dir);
27602760

2761-
trans = btrfs_start_transaction(root, 10);
2761+
/*
2762+
* 1 for the possible orphan item
2763+
* 1 for the dir item
2764+
* 1 for the dir index
2765+
* 1 for the inode ref
2766+
* 1 for the inode ref in the tree log
2767+
* 2 for the dir entries in the log
2768+
* 1 for the inode
2769+
*/
2770+
trans = btrfs_start_transaction(root, 8);
27622771
if (!IS_ERR(trans) || PTR_ERR(trans) != -ENOSPC)
27632772
return trans;
27642773

0 commit comments

Comments
 (0)