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: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Chao Yu 2018-01-17 16:31:37 +08:00 committed by Jaegeuk Kim
parent b323fd28bb
commit eb4497975e

View File

@ -1716,10 +1716,14 @@ write:
}
}
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)