Unverified Commit 491f9044 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

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

parents e89315eb b6fa4a8a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -768,6 +768,9 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
	int ret;
	bool snapshot_force_cow = false;

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

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