From 33818bbb84cd371b63ed8849cc5264d24c8b3aa2 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Tue, 28 Aug 2007 21:29:32 +0300 Subject: UBI: allocate memory with GFP_NOFS Use GFP_NOFS flag when allocating memory on I/O path, because otherwise we may deadlock the filesystem which works on top of us. We observed the deadlocks with UBIFS. Example: VFS->FS lock a lock->UBI->kmalloc()->VFS writeback->FS locks the same lock again. Signed-off-by: Artem Bityutskiy --- drivers/mtd/ubi/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/mtd/ubi/scan.c') diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 18c347b24e27..1c1401d6958b 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c @@ -323,7 +323,7 @@ static int compare_lebs(const struct ubi_device *ubi, } else { pnum = seb->pnum; - vh = ubi_zalloc_vid_hdr(ubi); + vh = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); if (!vh) return -ENOMEM; @@ -948,7 +948,7 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) if (!ech) goto out_si; - vidh = ubi_zalloc_vid_hdr(ubi); + vidh = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); if (!vidh) goto out_ech; -- cgit v1.2.2