linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] btrfs: don't BUG_ON btrfs_alloc_path errors v2
@ 2011-07-21 19:48 Mark Fasheh
  2011-07-21 19:48 ` [PATCH 1/7] btrfs: don't BUG_ON btrfs_alloc_path() errors Mark Fasheh
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Fasheh @ 2011-07-21 19:48 UTC (permalink / raw)
  To: linux-btrfs; +Cc: chris.mason

Changelog:
  - Updated patch 6 after review from Tsutomu Itoh

Hi,

	The following patches attempt to replace all the paths where we
BUG_ON the return value of btrfs_alloc_path with proper error handling. It's
pretty clear that these places aren't BUGing because of code error. To be
explicit, much of the code is doing something like this:

	path = btrfs_alloc_path();
	BUG_ON(!path);

which can be fixed by sending -ENOMEM back up the stack instead of the BUG.

	The first patch in my series fixes the most trivial sites in one go.
The patches after the 1st fix one (more complicated) site each. In the patch
descriptions I try my best to describe the thought process that went behind
each change.

	Generally my guiding principle is that we want to "bubble up" some
of the BUG_ON's that can be trapped and handled at a higher level -- the lower
layer has an error and instead of killing the machine, sends it back up the
stack for later handling

	I tested the patches with some kernel builds and snapshot commands.
Please review - comments and feedback are welcome.

The patches can also be had from git:

git pull git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/btrfs-error-handling.git alloc_path
	--Mark


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH 0/7] btrfs: don't BUG_ON btrfs_alloc_path errors
@ 2011-07-14 22:14 Mark Fasheh
  2011-07-14 22:14 ` [PATCH 1/7] btrfs: don't BUG_ON btrfs_alloc_path() errors Mark Fasheh
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Fasheh @ 2011-07-14 22:14 UTC (permalink / raw)
  To: linux-btrfs; +Cc: chris.mason

Hi,

	The following patches attempt to replace all the paths where we
BUG_ON the return value of btrfs_alloc_path with proper error handling. It's
pretty clear that these places aren't BUGing because of code error. To be
explicit, much of the code is doing something like this:

	path = btrfs_alloc_path();
	BUG_ON(!path);

which can be fixed by sending -ENOMEM back up the stack instead of the BUG.

	The first patch in my series fixes the most trivial sites in one go.
The patches after the 1st fix one (more complicated) site each. In the patch
descriptions I try my best to describe the thought process that went behind
each change.

	Generally my guiding principle is that we want to "bubble up" some
of the BUG_ON's that can be trapped and handled at a higher level -- the lower
layer has an error and instead of killing the machine, sends it back up the
stack for later handling

	I tested the patches with some kernel builds and snapshot commands.
Please review - comments and feedback are welcome.

The patches can also be had from git:

git pull git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/btrfs-error-handling.git alloc_path
	--Mark


 extent-tree.c |   20 +++++++++++++++-----
 file-item.c   |    7 +++++--
 file.c        |    3 ++-
 inode.c       |   49 +++++++++++++++++++++++++++++++++++--------------
 tree-log.c    |   12 +++++++++---
 volumes.c     |   12 ++++++++----
 6 files changed, 74 insertions(+), 29 deletions(-)

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

end of thread, other threads:[~2011-07-26 13:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-21 19:48 [PATCH 0/7] btrfs: don't BUG_ON btrfs_alloc_path errors v2 Mark Fasheh
2011-07-21 19:48 ` [PATCH 1/7] btrfs: don't BUG_ON btrfs_alloc_path() errors Mark Fasheh
2011-07-21 19:48   ` [PATCH 2/7] btrfs: Don't BUG_ON alloc_path errors in replay_one_buffer() Mark Fasheh
2011-07-21 19:48     ` [PATCH 3/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_truncate_inode_items Mark Fasheh
2011-07-21 19:48       ` [PATCH 4/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_read_locked_inode Mark Fasheh
2011-07-21 19:48         ` [PATCH 5/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_balance() Mark Fasheh
2011-07-21 19:48           ` [PATCH 6/7] btrfs: Don't BUG_ON alloc_path errors in find_next_chunk Mark Fasheh
2011-07-21 19:48             ` [PATCH 7/7] btrfs: don't BUG_ON allocation errors in btrfs_drop_snapshot Mark Fasheh
2011-07-22  0:45               ` Tsutomu Itoh
2011-07-25 21:10                 ` Mark Fasheh
2011-07-26 13:14                   ` Justin Ossevoort
2011-07-22  0:56             ` [PATCH 6/7] btrfs: Don't BUG_ON alloc_path errors in find_next_chunk Tsutomu Itoh
2011-07-25 21:37               ` Mark Fasheh
  -- strict thread matches above, loose matches on Subject: below --
2011-07-14 22:14 [PATCH 0/7] btrfs: don't BUG_ON btrfs_alloc_path errors Mark Fasheh
2011-07-14 22:14 ` [PATCH 1/7] btrfs: don't BUG_ON btrfs_alloc_path() errors Mark Fasheh
2011-07-14 22:14   ` [PATCH 2/7] btrfs: Don't BUG_ON alloc_path errors in replay_one_buffer() Mark Fasheh
2011-07-14 22:14     ` [PATCH 3/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_truncate_inode_items Mark Fasheh
2011-07-14 22:14       ` [PATCH 4/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_read_locked_inode Mark Fasheh
2011-07-14 22:15         ` [PATCH 5/7] btrfs: Don't BUG_ON alloc_path errors in btrfs_balance() Mark Fasheh

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