* [PATCH] f2fs: remove unneeded check for error allocating bio_post_read_ctx
@ 2019-12-31 18:14 ` Eric Biggers
0 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2019-12-31 18:14 UTC (permalink / raw)
To: linux-f2fs-devel; +Cc: linux-fscrypt
From: Eric Biggers <ebiggers@google.com>
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 <ebiggers@google.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [f2fs-dev] [PATCH] f2fs: remove unneeded check for error allocating bio_post_read_ctx
@ 2019-12-31 18:14 ` Eric Biggers
0 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2019-12-31 18:14 UTC (permalink / raw)
To: linux-f2fs-devel; +Cc: linux-fscrypt
From: Eric Biggers <ebiggers@google.com>
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 <ebiggers@google.com>
---
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
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] f2fs: remove unneeded check for error allocating bio_post_read_ctx
2019-12-31 18:14 ` [f2fs-dev] " Eric Biggers
@ 2020-01-02 8:13 ` Chao Yu
-1 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2020-01-02 8:13 UTC (permalink / raw)
To: Eric Biggers, linux-f2fs-devel; +Cc: linux-fscrypt
On 2020/1/1 2:14, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> 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 <ebiggers@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: remove unneeded check for error allocating bio_post_read_ctx
@ 2020-01-02 8:13 ` Chao Yu
0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2020-01-02 8:13 UTC (permalink / raw)
To: Eric Biggers, linux-f2fs-devel; +Cc: linux-fscrypt
On 2020/1/1 2:14, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> 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 <ebiggers@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-02 8:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-31 18:14 [PATCH] f2fs: remove unneeded check for error allocating bio_post_read_ctx Eric Biggers
2019-12-31 18:14 ` [f2fs-dev] " Eric Biggers
2020-01-02 8:13 ` Chao Yu
2020-01-02 8:13 ` [f2fs-dev] " Chao Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.