linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] Add readonly support to replace BUG_ON phrase
@ 2010-11-25  9:52 Miao Xie
  2010-11-25 10:57 ` Wenyi Liu
  2010-11-29 20:10 ` Josef Bacik
  0 siblings, 2 replies; 8+ messages in thread
From: Miao Xie @ 2010-11-25  9:52 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik; +Cc: Linux Btrfs, Liu Bo

Btrfs has a number of BUG_ON()s, which may lead btrfs to unpleasant panic.
Meanwhile, they are very ugly and should be handled more propriately.

There are mainly two ways to deal with these BUG_ON()s.

1. For those errors which can be handled well by callers, we just return their
error number to callers.

2. For others, We can force the filesystem readonly when it hits errors, which
 is what this patchset has done. Replaced BUG_ON() with the interface provided
 in this patchset, we will get error infomation via dmesg. Since btrfs is now 
readonly, we can save our data safely and umount it, then a btrfsck is 
recommended.

By these ways, we can protect our filesystem from panic caused by those 
BUG_ONs.

---
 fs/btrfs/ctree.h       |   21 ++++++++++
 fs/btrfs/disk-io.c     |   23 +++++++++++
 fs/btrfs/super.c       |  100 ++++++++++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/transaction.c |    7 +++
 4 files changed, 148 insertions(+), 3 deletions(-)


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

end of thread, other threads:[~2010-11-30  5:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25  9:52 [RFC PATCH 0/4] Add readonly support to replace BUG_ON phrase Miao Xie
2010-11-25 10:57 ` Wenyi Liu
2010-11-29 20:10 ` Josef Bacik
2010-11-29 21:12   ` Mike Fedyk
2010-11-29 21:22     ` Josef Bacik
2010-11-30  2:03   ` liubo
2010-11-30  2:30     ` Josef Bacik
2010-11-30  5:28       ` liubo

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).