Skip to contentSkip to conversation

fs: grow_dev_page() failure path not a BUG()

PATCH New Louis Huemiller 1 participant 1 message Oct 20, 2011 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: grow_dev_page() failure path not a BUG()

The function grow_dev_page() contains a label named failed which is jumped to on allocation failure. When the system is low on memory, which is not a bug, this path can be taken. This patch removes the BUG() call, so that this path can be exercised for proper operation on a debug kernel, without panicing the system.

---
 fs/buffer.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
fs/buffer.c +0 -1
index 1a80b04..04781e6 100644
@@ -1032,7 +1032,6 @@ grow_dev_page(struct block_device *bdev, sector_t block,
 	return page;
 
 failed:
-	BUG();
 	unlock_page(page);
 	page_cache_release(page);
 	return NULL;
Signature · 1 line
1.7.3.1