From bca4ad7c0b547b01ed4bd244dc54be18ba6cc708 Mon Sep 17 00:00:00 2001 From: Omar Sandoval Date: Wed, 9 Mar 2022 17:31:31 -0800 Subject: [PATCH] btrfs: reserve correct number of items for unlink and rmdir __btrfs_unlink_inode() calls btrfs_update_inode() on the parent directory in order to update its size and sequence number. Make sure we account for it. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Signed-off-by: David Sterba --- fs/btrfs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 95c499b8424e..388259204aae 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4199,8 +4199,9 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir) * 1 for the dir index * 1 for the inode ref * 1 for the inode + * 1 for the parent inode */ - return btrfs_start_transaction_fallback_global_rsv(root, 5); + return btrfs_start_transaction_fallback_global_rsv(root, 6); } static int btrfs_unlink(struct inode *dir, struct dentry *dentry)