Skip to contentSkip to conversation

Btrfs: do not BUG if we fail to remove the orphan item for dead snapshots

PATCH In review Josef Bacik 3 participants 4 messages Dec 8, 2010 – Dec 10, 2010 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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. Thanks,

---
 fs/btrfs/extent-tree.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
fs/btrfs/extent-tree.c +0 -1
index 8aed05e..8c26441 100644
@@ -6354,7 +6354,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
 		if (ret > 0) {
 			ret = btrfs_del_orphan_item(trans, tree_root,
 						    root->root_key.objectid);
-			BUG_ON(ret);
 		}
 	}
 
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 4 lines · Josef Bacik

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. Thanks,

Would be better to add code comment? Otherwise later people may wonder why the return value is not checked and see it as a bug.

Quoted 17 lines
---
 fs/btrfs/extent-tree.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
fs/btrfs/extent-tree.c +0 -1
index 8aed05e..8c26441 100644
@@ -6354,7 +6354,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
 		if (ret > 0) {
 			ret = btrfs_del_orphan_item(trans, tree_root,
 						    root->root_key.objectid);
-			BUG_ON(ret);
 		}
 	}
 
#2 lore raw
Quoted 9 lines · Li Zefan
Quoted 4 lines · Josef Bacik

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. Thanks,

Would be better to add code comment? Otherwise later people may wonder why the return value is not checked and see it as a bug.

Comments are against Btrfs' coding style guidlines.

Josef

#3 lore raw

Excerpts from Josef Bacik's message of 2010-12-10 08:30:36 -0500:

Quoted 7 lines · Li Zefan
Quoted 6 lines
Quoted 4 lines · Josef Bacik

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. Thanks,

Quoted 5 lines
Quoted 3 lines

Would be better to add code comment? Otherwise later people may wonder why the return value is not checked and see it as a bug.

Comments are against Btrfs' coding style guidlines.

But not the new and improved coding style guidelines ;)

-chris