From: Julian Sun <sunjunchao2870@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz,
Julian Sun <sunjunchao2870@gmail.com>
Subject: [PATCH] ext4: remove unnecessary checks for __GFP_NOFAIL allocation.
Date: Fri, 28 Feb 2025 16:11:26 +0800 [thread overview]
Message-ID: <20250228081126.2634480-1-sunjunchao2870@gmail.com> (raw)
The __GFP_NOFAIL flag ensures that allocation will not fail.
So remove the unnecessary checks.
Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
---
fs/ext4/extents.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index a07a98a4b97a..95debd5d6506 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2940,10 +2940,6 @@ int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start,
} else {
path = kcalloc(depth + 1, sizeof(struct ext4_ext_path),
GFP_NOFS | __GFP_NOFAIL);
- if (path == NULL) {
- ext4_journal_stop(handle);
- return -ENOMEM;
- }
path[0].p_maxdepth = path[0].p_depth = depth;
path[0].p_hdr = ext_inode_hdr(inode);
i = 0;
--
2.39.5
next reply other threads:[~2025-02-28 8:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 8:11 Julian Sun [this message]
2025-02-28 8:44 ` [PATCH] ext4: remove unnecessary checks for __GFP_NOFAIL allocation Baokun Li
2025-02-28 9:30 ` Julian Sun
2025-02-28 13:34 ` Theodore Ts'o
2025-03-01 14:32 ` Julian Sun
2025-02-28 10:19 ` Zhang Yi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250228081126.2634480-1-sunjunchao2870@gmail.com \
--to=sunjunchao2870@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox