Skip to contentSkip to conversation

btrfs: fix wrong allocating flag when reading page

PATCH In review Miao Xie 1 participant 1 message Apr 22, 2011 Btrfs file system

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH v6 1/3 btrfs: fix wrong allocating flag when reading page

From: Itaru Kitayama <[email protected]>

the space cache use extent_readpages() to read free space information, so we can not use GFP_KERNEL flag to allocate memory, or it may lead to deadlock.

---
 fs/btrfs/extent_io.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/extent_io.c +1 -1
index 5ae0bff..0d1196d 100644
@@ -2681,7 +2681,7 @@ int extent_readpages(struct extent_io_tree *tree,
 		prefetchw(&page->flags);
 		list_del(&page->lru);
 		if (!add_to_page_cache_lru(page, mapping,
-					page->index, GFP_KERNEL)) {
+					page->index, GFP_NOFS)) {
 			__extent_read_full_page(tree, page, get_extent,
 						&bio, 0, &bio_flags);
 		}
Signature · 1 line
1.7.4