public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: remove unnecessary checks for __GFP_NOFAIL allocation.
@ 2025-02-28  8:11 Julian Sun
  2025-02-28  8:44 ` Baokun Li
  2025-02-28 10:19 ` Zhang Yi
  0 siblings, 2 replies; 6+ messages in thread
From: Julian Sun @ 2025-02-28  8:11 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, adilger.kernel, jack, Julian Sun

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-01 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28  8:11 [PATCH] ext4: remove unnecessary checks for __GFP_NOFAIL allocation Julian Sun
2025-02-28  8:44 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox