diff options
-rw-r--r-- | fs/f2fs/data.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 2b892a619d71..fa91bfeb754b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1716,10 +1716,14 @@ write: } } - 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); + 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) |