Re: [PATCH 1/2] ext4: reduce computation of overhead during resize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Jul 15, 2022, at 2:27 AM, Jan Kara <jack@xxxxxxx> wrote:
> 
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
> 
> 
> 
> On Thu 14-07-22 19:53:38, Kiselev, Oleg wrote:
>>> 
>>>> +       sbi->s_overhead += overhead;
>>>> +       es->s_overhead_clusters = cpu_to_le32((unsigned long) sbi->s_overhead);
>>>                                               ^^^ the typecast looks
>>> bogus here...
>> 
>> This cast is the reverse of le32_to_cpu() cast done in fs/ext4/super.c:__ext4_fill_super():
>>        sbi->s_overhead = le32_to_cpu(es->s_overhead_clusters);
>> And follows the logic of casting done in fs/ext4/ioctl.c:set_overhead() and fs/ext4/ioctl.c:ext4_update_overhead().
> 
> I didn't mean the cpu_to_le32() call but rather the (unsigned long) part.
> That is pointless because sbi->s_overhead is already 'unsigned long' and
> even if it was not, I have hard time seeing a reason why would casting to
> unsigned long make any difference here.

Got it.  You are right.  The indent of your comment got mangled by mail, so it looked like it was directed to cpu_to_ie32()!  

> 
>                                                                        Honza
> --
> Jan Kara <jack@xxxxxxxx>
> SUSE Labs, CR





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux