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

Commit cd576d7b authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: fix to update last_disk_size correctly



This patch fixes to update last_disk_size only when writing out page
successfully.

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 7a57bd33
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -1716,10 +1716,14 @@ static int __write_data_page(struct page *page, bool *submitted,
		}
	}

	if (err) {
		file_set_keep_isize(inode);
	} else {
		down_write(&F2FS_I(inode)->i_sem);
		if (F2FS_I(inode)->last_disk_size < psize)
			F2FS_I(inode)->last_disk_size = psize;
		up_write(&F2FS_I(inode)->i_sem);
	}

done:
	if (err && err != -ENOENT)