f2fs: truncate preallocated blocks in error case
authorJaegeuk Kim <jaegeuk@kernel.org>
Sat, 31 Mar 2018 00:58:13 +0000 (17:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jul 2018 14:29:21 +0000 (16:29 +0200)
commit42dc2a7bb72ed376ccfe8b8f49187a00f893c53f
tree7cc9b3eb234218c4a0de0e66d8e6fa862aad6b80
parenta2c7493c7f31c0e4d1dede9a179f853484f7dd1d
f2fs: truncate preallocated blocks in error case

commit dc7a10ddee0c56c6d891dd18de5c4ee9869545e0 upstream.

If write is failed, we must deallocate the blocks that we couldn't write.

Cc: stable@vger.kernel.org
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/file.c