linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] replaced BUG() with return -EIO from ext4_ext_get_blocks
@ 2009-12-11 14:06 Surbhi Palande
  2009-12-11 18:07 ` Frank Mayhar
  0 siblings, 1 reply; 10+ messages in thread
From: Surbhi Palande @ 2009-12-11 14:06 UTC (permalink / raw)
  To: linux-ext4

This patch fixes the upstream bug# 14286. When the address of an extent
corresponding to a given block is NULL and the tree is being traversed for
fetching such an address, a -EIO should be reported instead of a BUG(). This
situation should normally not occur. However if it does, then the system
should be rendered usable.

Signed-off-by: Surbhi Palande <surbhi.palande@canonical.com>
---
 fs/ext4/extents.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 3a7928f..51f87f3 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3190,7 +3190,12 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
 	 * this situation is possible, though, _during_ tree modification;
 	 * this is why assert can't be put in ext4_ext_find_extent()
 	 */
-	BUG_ON(path[depth].p_ext == NULL && depth != 0);
+	if (path[depth].p_ext == NULL && depth != 0) {
+		err = -EIO;
+		printk(KERN_ERR "\n ext4 fs error in %s,%s,%s while reading a block ", \
+					__FILE__, __func__, __LINE__);
+		goto out2;
+	}
 	eh = path[depth].p_hdr;
 
 	ex = path[depth].p_ext;
-- 
1.6.3.3


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

end of thread, other threads:[~2009-12-14 15:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11 14:06 [PATCH] replaced BUG() with return -EIO from ext4_ext_get_blocks Surbhi Palande
2009-12-11 18:07 ` Frank Mayhar
2009-12-11 20:02   ` Eric Sandeen
2009-12-11 20:22     ` Frank Mayhar
2009-12-11 20:31       ` Eric Sandeen
2009-12-11 21:11         ` Frank Mayhar
2009-12-11 22:11       ` Surbhi Palande
2009-12-11 22:16         ` Frank Mayhar
2009-12-12 21:00     ` [PATCH v2] " Surbhi Palande
2009-12-14 15:04       ` tytso

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