From: Jaegeuk Kim Date: Wed, 19 Jul 2017 17:59:55 +0000 (-0700) Subject: f2fs: give a try to do atomic write in -ENOMEM case X-Git-Tag: v4.14-rc1~46^2~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=640cc18982b1c2049ac3a7223444248aea7d51b4;p=platform%2Fkernel%2Flinux-rpi.git f2fs: give a try to do atomic write in -ENOMEM case It'd be better to retry writing atomic pages when we get -ENOMEM. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index f964b68..f5d139f 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -309,17 +309,21 @@ static int __commit_inmem_pages(struct inode *inode, inode_dec_dirty_pages(inode); remove_dirty_inode(inode); } - +retry: fio.page = page; fio.old_blkaddr = NULL_ADDR; fio.encrypted_page = NULL; fio.need_lock = LOCK_DONE; err = do_write_data_page(&fio); if (err) { + if (err == -ENOMEM) { + congestion_wait(BLK_RW_ASYNC, HZ/50); + cond_resched(); + goto retry; + } unlock_page(page); break; } - /* record old blkaddr for revoking */ cur->old_addr = fio.old_blkaddr; last_idx = page->index;