Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0be2e981 authored by Miao Xie's avatar Miao Xie Committed by Chris Mason
Browse files

btrfs: fix btrfs_mkdir goto for no free objectids



btrfs_mkdir() must jump to the place of ending transaction after
btrfs_find_free_objectid() failed. Or this transaction can't end.

Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 0bdb1db2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -4508,7 +4508,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
	err = btrfs_find_free_objectid(trans, root, dir->i_ino, &objectid);
	err = btrfs_find_free_objectid(trans, root, dir->i_ino, &objectid);
	if (err) {
	if (err) {
		err = -ENOSPC;
		err = -ENOSPC;
		goto out_unlock;
		goto out_fail;
	}
	}


	inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
	inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,