linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: don't panic if orphan item already exists
@ 2011-12-13 17:55 Josef Bacik
  2011-12-13 19:03 ` Phillip Susi
  0 siblings, 1 reply; 17+ messages in thread
From: Josef Bacik @ 2011-12-13 17:55 UTC (permalink / raw)
  To: linux-btrfs

I've been hitting this BUG_ON() in btrfs_orphan_add when running xfstest 269 in
a loop.  This is because we will add an orphan item, do the truncate, the
truncate will fail for whatever reason (*cough*ENOSPC*cough*) and then we're
left with an orphan item still in the fs.  Then we come back later to do another
truncate and it blows up because we already have an orphan item.  This is ok so
just fix the BUG_ON() to only BUG() if ret is not EEXIST.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
---
 fs/btrfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ae5b354a..76e6c24 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2047,7 +2047,7 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode)
 	/* insert an orphan item to track this unlinked/truncated file */
 	if (insert >= 1) {
 		ret = btrfs_insert_orphan_item(trans, root, btrfs_ino(inode));
-		BUG_ON(ret);
+		BUG_ON(ret && ret != -EEXIST);
 	}
 
 	/* insert an orphan item to track subvolume contains orphan files */
-- 
1.7.5.2


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-12-15  1:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-13 17:55 [PATCH] Btrfs: don't panic if orphan item already exists Josef Bacik
2011-12-13 19:03 ` Phillip Susi
2011-12-13 19:09   ` Josef Bacik
2011-12-14  2:07     ` WuBo
2011-12-14  9:46       ` Miao Xie
2011-12-14 14:58         ` Josef Bacik
2011-12-14 15:14           ` Phillip Susi
2011-12-14 15:27             ` Josef Bacik
2011-12-14 15:41               ` Phillip Susi
2011-12-14 15:46                 ` Josef Bacik
2011-12-14 19:59                   ` Phillip Susi
2011-12-14 15:34             ` Josef Bacik
2011-12-14 15:35               ` Josef Bacik
2011-12-14 16:45               ` Chris Mason
2011-12-14 16:47                 ` Josef Bacik
2011-12-15  1:42               ` Miao Xie
2011-12-15  1:56           ` WuBo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).