diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-08-28 14:29:32 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-10-14 06:10:20 -0400 |
commit | 33818bbb84cd371b63ed8849cc5264d24c8b3aa2 (patch) | |
tree | ecee6a8f02d2d103c6eb33cc6173e74343b1861b /drivers/mtd/ubi/scan.c | |
parent | ef6075fbfca9139f428d52d60e671da38aa2e212 (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/scan.c')
-rw-r--r-- | drivers/mtd/ubi/scan.c | 4 |
1 files changed, 2 insertions, 2 deletions
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, | |||
323 | } else { | 323 | } else { |
324 | pnum = seb->pnum; | 324 | pnum = seb->pnum; |
325 | 325 | ||
326 | vh = ubi_zalloc_vid_hdr(ubi); | 326 | vh = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); |
327 | if (!vh) | 327 | if (!vh) |
328 | return -ENOMEM; | 328 | return -ENOMEM; |
329 | 329 | ||
@@ -948,7 +948,7 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) | |||
948 | if (!ech) | 948 | if (!ech) |
949 | goto out_si; | 949 | goto out_si; |
950 | 950 | ||
951 | vidh = ubi_zalloc_vid_hdr(ubi); | 951 | vidh = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); |
952 | if (!vidh) | 952 | if (!vidh) |
953 | goto out_ech; | 953 | goto out_ech; |
954 | 954 | ||