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

!5765 [sync] PR-5642: btrfs: don't abort filesystem when attempting to snapshot deleted subvolume

parents ed86ac20 059f607d
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;