summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJack Qiu <jack.qiu@huawei.com>2022-05-31 03:16:56 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2022-06-28 18:27:09 +0200
commita4a0e16dbf77582c4f58ab472229dd071b5c4260 (patch)
treeaff33bc363effba90efde38cc90b3b66081c99bc /fs/f2fs
parentf2fs: do not skip updating inode when retrying to flush node page (diff)
downloadlinux-a4a0e16dbf77582c4f58ab472229dd071b5c4260.tar.xz
linux-a4a0e16dbf77582c4f58ab472229dd071b5c4260.zip
f2fs: optimize error handling in redirty_blocks
Current error handling is at risk of page leaks. However, we dot't seek any failure scenarios, just use f2fs_bug_on. Signed-off-by: Jack Qiu <jack.qiu@huawei.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index bd14cef1b08f..2d1114b0ceef 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -3903,10 +3903,10 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
for (i = 0; i < page_len; i++, redirty_idx++) {
page = find_lock_page(mapping, redirty_idx);
- if (!page) {
- ret = -ENOMEM;
- break;
- }
+
+ /* It will never fail, when page has pinned above */
+ f2fs_bug_on(F2FS_I_SB(inode), !page);
+
set_page_dirty(page);
f2fs_put_page(page, 1);
f2fs_put_page(page, 0);