Unverified Commit 9424f746 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5642 btrfs: don't abort filesystem when attempting to snapshot deleted subvolume

parents 28a226c3 dae4b701
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -798,6 +798,9 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
	struct btrfs_trans_handle *trans;
	int ret;

	if (btrfs_root_refs(&root->root_item) == 0)
		return -ENOENT;

	if (!test_bit(BTRFS_ROOT_SHAREABLE, &root->state))
		return -EINVAL;