lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 15 Jul 2022 11:27:36 +0200
From:   Jan Kara <jack@...e.cz>
To:     "Kiselev, Oleg" <okiselev@...zon.com>
Cc:     Jan Kara <jack@...e.cz>,
        "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
        Theodore Ts'o <tytso@....edu>
Subject: Re: [PATCH 1/2] ext4: reduce computation of overhead during resize

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.

									Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ