f2fs: avoid unneeded error handling for revoke_entry_slab allocation
authorChao Yu <chao@kernel.org>
Wed, 25 May 2022 01:56:34 +0000 (09:56 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 25 May 2022 06:06:51 +0000 (23:06 -0700)
In __f2fs_commit_atomic_write(), we will guarantee success of
revoke_entry_slab allocation, so let's avoid unneeded error handling.

Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index 0a4180f64291cc574ace5c82dc2478f24d065733..51ceff797b9727377a51c28802666970fa7b208b 100644 (file)
@@ -315,11 +315,6 @@ static int __f2fs_commit_atomic_write(struct inode *inode)
 
                        new = f2fs_kmem_cache_alloc(revoke_entry_slab, GFP_NOFS,
                                                        true, NULL);
-                       if (!new) {
-                               f2fs_put_dnode(&dn);
-                               ret = -ENOMEM;
-                               goto out;
-                       }
 
                        ret = __replace_atomic_write_block(inode, index, blkaddr,
                                                        &new->old_addr, false);