From: Eric Biggers <[email protected]>

Since allocating an object from a mempool never fails when
__GFP_DIRECT_RECLAIM (which is included in GFP_NOFS) is set, the check
for failure to allocate a bio_post_read_ctx is unnecessary.  Remove it.

Signed-off-by: Eric Biggers <[email protected]>
---
 fs/f2fs/data.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 618a05bf356e..b52e1512f82e 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -939,11 +939,8 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, 
block_t blkaddr,
                post_read_steps |= 1 << STEP_VERITY;
 
        if (post_read_steps) {
+               /* Due to the mempool, this never fails. */
                ctx = mempool_alloc(bio_post_read_ctx_pool, GFP_NOFS);
-               if (!ctx) {
-                       bio_put(bio);
-                       return ERR_PTR(-ENOMEM);
-               }
                ctx->bio = bio;
                ctx->sbi = sbi;
                ctx->enabled_steps = post_read_steps;
-- 
2.24.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to