Re: [f2fs-dev] [PATCH v2 1/2] f2fs: use BIT_ULL for mount option bitmasks
From: Chao Yu
Date: Tue Oct 20 2026 - 05:18:49 EST
FYI, in dev, it missed to add my rvb.
On 9/14/26 10:53, Chao Yu wrote:
> On 9/11/26 22:35, Daeho Jeong wrote:
>> From: Daeho Jeong <daehojeong@xxxxxxxxxx>
>>
>> Although f2fs_mount_info.opt and f2fs_fs_context.opt_mask are declared as
>> unsigned long long (64 bits), the option bit manipulation macros
>> (clear_opt, set_opt, test_opt) and context helpers (ctx_set_opt,
>> ctx_clear_opt, ctx_test_opt) use BIT(), which expands to (UL(1) << nr).
>>
>> On 32-bit architectures, sizeof(unsigned long) is 32 bits, causing shift
>> count overflow warnings and functional truncation if mount option indices
>> reach or exceed 32.
>>
>> Replace BIT() with BIT_ULL() for mount option bitmasks and helpers.
>> Additionally, introduce ctx_clear_opt_mask() and ctx_test_opt_mask()
>> helpers to avoid open-coded bitwise manipulations on ctx->opt_mask.
>>
>> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202609111633.uyRbsEUB-lkp@xxxxxxxxx/
>> Signed-off-by: Daeho Jeong <daehojeong@xxxxxxxxxx>
>
> Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
>
> Thanks,