forked from Minki/linux
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:
parent
b323fd28bb
commit
eb4497975e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user