From: Josef Bacik Date: Wed, 8 Dec 2010 17:24:01 +0000 (-0500) Subject: Btrfs: do not BUG if we fail to remove the orphan item for dead snapshots X-Git-Tag: upstream/snapshot3+hdmi~11282^2~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84cd948cb11041f205242de457e680b9bb872a36;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Btrfs: do not BUG if we fail to remove the orphan item for dead snapshots Not being able to delete an orphan item isn't a horrible thing. The worst that happens is the next time around we try and do the orphan cleanup and we can't find the referenced object and just delete the item and move on. Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index cec05e1..41133b0 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -6309,9 +6309,13 @@ int btrfs_drop_snapshot(struct btrfs_root *root, NULL, NULL); BUG_ON(ret < 0); if (ret > 0) { - ret = btrfs_del_orphan_item(trans, tree_root, - root->root_key.objectid); - BUG_ON(ret); + /* if we fail to delete the orphan item this time + * around, it'll get picked up the next time. + * + * The most common failure here is just -ENOENT. + */ + btrfs_del_orphan_item(trans, tree_root, + root->root_key.objectid); } }