Re: [PATCH] hugetlbfs: Fix integer overflow check in hugetlbfs_file_mmap()

From: linke li
Date: Thu Jul 20 2023 - 02:25:21 EST


> > What about using the check_add_overflow() macro?
>
> I like the macro. It seems to have plenty of users.
>
> Linke Li, what do you think? If you like, please send another path
> using the macro as suggested by Dan.

Thanks for Dan's advice. I have tested this macro in gcc-9 and clang-14, it
can work well in both compilers and regardless of whether "-fno-strict-overflow"
is added or not.

I will send a new patch.

Best Regards