Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5768dcdd authored by Fan Li's avatar Fan Li Committed by Jaegeuk Kim
Browse files

f2fs: change the timing of f2fs_wait_on_page_writeback



some backing devices need pages to be stable during writeback. It doesn't
matter if
the page is completely overwritten or already uptodate, it needs to wait
before write.

Signed-off-by: default avatarFan li <fanofcode.li@samsung.com>
Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent edb27dee
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1383,13 +1383,13 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
	f2fs_put_dnode(&dn);
	f2fs_unlock_op(sbi);

	f2fs_wait_on_page_writeback(page, DATA);

	if (len == PAGE_CACHE_SIZE)
		goto out_update;
	if (PageUptodate(page))
		goto out_clear;

	f2fs_wait_on_page_writeback(page, DATA);

	if ((pos & PAGE_CACHE_MASK) >= i_size_read(inode)) {
		unsigned start = pos & (PAGE_CACHE_SIZE - 1);
		unsigned end = start + len;