aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/io.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-08-28 14:29:32 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-10-14 06:10:20 -0400
commit33818bbb84cd371b63ed8849cc5264d24c8b3aa2 (patch)
treeecee6a8f02d2d103c6eb33cc6173e74343b1861b /drivers/mtd/ubi/io.c
parentef6075fbfca9139f428d52d60e671da38aa2e212 (diff)
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 <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/io.c')
-rw-r--r--drivers/mtd/ubi/io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 928476394d55..ba5bc4a5379e 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -1099,7 +1099,7 @@ static int paranoid_check_peb_ec_hdr(const struct ubi_device *ubi, int pnum)
1099 uint32_t crc, hdr_crc; 1099 uint32_t crc, hdr_crc;
1100 struct ubi_ec_hdr *ec_hdr; 1100 struct ubi_ec_hdr *ec_hdr;
1101 1101
1102 ec_hdr = kzalloc(ubi->ec_hdr_alsize, GFP_KERNEL); 1102 ec_hdr = kzalloc(ubi->ec_hdr_alsize, GFP_NOFS);
1103 if (!ec_hdr) 1103 if (!ec_hdr)
1104 return -ENOMEM; 1104 return -ENOMEM;
1105 1105
@@ -1179,7 +1179,7 @@ static int paranoid_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum)
1179 struct ubi_vid_hdr *vid_hdr; 1179 struct ubi_vid_hdr *vid_hdr;
1180 void *p; 1180 void *p;
1181 1181
1182 vid_hdr = ubi_zalloc_vid_hdr(ubi); 1182 vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_NOFS);
1183 if (!vid_hdr) 1183 if (!vid_hdr)
1184 return -ENOMEM; 1184 return -ENOMEM;
1185 1185