From 38db195996791ae44df22ca4fc484cc3a7eb89a7 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Tue, 28 Aug 2007 20:33:32 +0300 Subject: [PATCH] --- yaml --- r: 68519 b: refs/heads/master c: 98b830d26095007aeb04041147b93d2b74e0a0c0 h: refs/heads/master i: 68517: 684571ff014ec1de97730ae3300bd4c922087db9 68515: 645a29c1e575ad61dd419bfcf4f511d915cc9b8e 68511: e6c1ba5db0a06662c229eac07130f0f1f59607a6 v: v3 --- [refs] | 2 +- trunk/drivers/mtd/nand/nandsim.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 1d60a5f963b2..31dd2dc8b598 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 241651d04d672fb685b2874707016cbbf95931e5 +refs/heads/master: 98b830d26095007aeb04041147b93d2b74e0a0c0 diff --git a/trunk/drivers/mtd/nand/nandsim.c b/trunk/drivers/mtd/nand/nandsim.c index 205df0f771fe..a7574807dc46 100644 --- a/trunk/drivers/mtd/nand/nandsim.c +++ b/trunk/drivers/mtd/nand/nandsim.c @@ -1272,7 +1272,13 @@ static int prog_page(struct nandsim *ns, int num) mypage = NS_GET_PAGE(ns); if (mypage->byte == NULL) { NS_DBG("prog_page: allocating page %d\n", ns->regs.row); - mypage->byte = kmalloc(ns->geom.pgszoob, GFP_KERNEL); + /* + * We allocate memory with GFP_NOFS because a flash FS may + * utilize this. If it is holding an FS lock, then gets here, + * then kmalloc runs writeback which goes to the FS again + * and deadlocks. This was seen in practice. + */ + mypage->byte = kmalloc(ns->geom.pgszoob, GFP_NOFS); if (mypage->byte == NULL) { NS_ERR("prog_page: error allocating memory for page %d\n", ns->regs.row); return -1;