Commit d9a25490 authored by Zhihao Cheng's avatar Zhihao Cheng
Browse files

ubi: fastmap: Allocate memory with GFP_NOFS in ubi_update_fastmap

mainline inclusion
from mainline-v6.7-rc1
commit a033ab4fec5fd9194d1b6c0306efbdc75f70b142
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9195H
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a033ab4fec5fd9194d1b6c0306efbdc75f70b142



-------------------------------------------------

Function ubi_update_fastmap could be called in IO context, for example:
 ubifs_writepage
  do_writepage
   ubifs_jnl_write_data
    write_head
     ubifs_wbuf_write_nolock
      ubifs_leb_write
       ubi_leb_write
        ubi_eba_write_leb
	 try_write_vid_and_data
	  ubi_wl_get_peb
	   ubi_update_fastmap
	    erase_block

So it's better to allocate memory with GFP_NOFS mode, in case waiting
page writeback(dead loop).

Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 02f9f25b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment