ext4: return 0 when ext4_get_group_info failed in __mb_check_buddy
PATCH 1/1 ext4: return 0 when ext4_get_group_info failed in __mb_check_buddy
The return value for __mb_check_buddy should be a integer. Found this by code review.
--- fs/ext4/mballoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/mballoc.c +1 -1
@@ -758,7 +758,7 @@ static int __mb_check_buddy(struct ext4_buddy *e4b, char *file, grp =ext4_get_group_info (sb, e4b->bd_group);if (!grp) -return NULL ; +return 0 ;list_for_each (cur, &grp->bb_prealloc_list) {ext4_group_t groupnr;struct ext4_prealloc_space *pa;
Signature · 1 line
2.39.2
Quoted 3 lines · yangerkun
The return value for
__mb_check_buddyshould be a integer. Found this by code review.
Hi yangerkun,
I think the return value of __mb_check_buddy is actually not used and can be removed. See [1] for details :). Thanks!
[1] https://lore.kernel.org/lkml/[email protected]/
Quoted 20 lines
Fixes 5354b2af3406 ("ext4: allow ext4_get_group_info() to fail")Signed-off-by yangerkun <[email protected]>--- fs/ext4/mballoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ext4/mballoc.c +1
-1@@ -758,7 +758,7 @@ static int __mb_check_buddy(struct ext4_buddy *e4b, char *file, grp =ext4_get_group_info (sb, e4b->bd_group);if (!grp) -return NULL ; +return 0 ;list_for_each (cur, &grp->bb_prealloc_list) {ext4_group_t groupnr;struct ext4_prealloc_space *pa;
Quoted 9 lines · Kemeng Shi
Quoted 3 lines · yangerkun
The return value for
__mb_check_buddyshould be a integer. Found this by code review.Hi yangerkun,
I think the return value of__mb_check_buddyis actually not used and can be removed. See [1] for details :). Thanks!
Hi Kemeng,
Yeah, the return value nowdays help nothing, it's a good choice to remove them all.
Thanks.
Quoted 24 lines
[1] https://lore.kernel.org/lkml/[email protected]/
Quoted 20 lines
Fixes 5354b2af3406 ("ext4: allow ext4_get_group_info() to fail")Signed-off-by yangerkun <[email protected]>--- fs/ext4/mballoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ext4/mballoc.c +1
-1@@ -758,7 +758,7 @@ static int __mb_check_buddy(struct ext4_buddy *e4b, char *file, grp =ext4_get_group_info (sb, e4b->bd_group);if (!grp) -return NULL ; +return 0 ;list_for_each (cur, &grp->bb_prealloc_list) {ext4_group_t groupnr;struct ext4_prealloc_space *pa;