Commit 640cc189 authored by Jaegeuk Kim's avatar Jaegeuk Kim

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: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 14af20fc
...@@ -309,17 +309,21 @@ static int __commit_inmem_pages(struct inode *inode, ...@@ -309,17 +309,21 @@ static int __commit_inmem_pages(struct inode *inode,
inode_dec_dirty_pages(inode); inode_dec_dirty_pages(inode);
remove_dirty_inode(inode); remove_dirty_inode(inode);
} }
retry:
fio.page = page; fio.page = page;
fio.old_blkaddr = NULL_ADDR; fio.old_blkaddr = NULL_ADDR;
fio.encrypted_page = NULL; fio.encrypted_page = NULL;
fio.need_lock = LOCK_DONE; fio.need_lock = LOCK_DONE;
err = do_write_data_page(&fio); err = do_write_data_page(&fio);
if (err) { if (err) {
if (err == -ENOMEM) {
congestion_wait(BLK_RW_ASYNC, HZ/50);
cond_resched();
goto retry;
}
unlock_page(page); unlock_page(page);
break; break;
} }
/* record old blkaddr for revoking */ /* record old blkaddr for revoking */
cur->old_addr = fio.old_blkaddr; cur->old_addr = fio.old_blkaddr;
last_idx = page->index; last_idx = page->index;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment