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]
Message-ID: <CEA2256B.7F605%andreas.dilger@intel.com>
Date:	Fri, 8 Nov 2013 12:25:30 +0000
From:	"Dilger, Andreas" <andreas.dilger@...el.com>
To:	Theodore Ts'o <tytso@....edu>
CC:	"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: return non-zero st_blocks for inline data

On 2013/11/07 8:45 PM, "Theodore Ts'o" <tytso@....edu> wrote:

>On Wed, Nov 06, 2013 at 03:42:32AM -0700, Andreas Dilger wrote:
>> @@ -4542,9 +4551,9 @@ int ext4_getattr(struct vfsmount *mnt, struct
>>dentry *dentry,
>>  	 * blocks for this file.
>>  	 */
>>  	delalloc_blocks = EXT4_C2B(EXT4_SB(inode->i_sb),
>> -				EXT4_I(inode)->i_reserved_data_blocks);
>> +				   EXT4_I(inode)->i_reserved_data_blocks);
>> +	stat->blocks += delalloc_blocks << (inode->i_sb->s_blocksize_bits -
>>9);
>>  
>> -	stat->blocks += (delalloc_blocks << inode->i_sb->s_blocksize_bits)>>9;
>
>Why this change to the calculation to stat->blocks?

Just code cleanup.  The lack of spaces around ">>9" irked me.

The calculation is the same (s_blocksize_bits can never be less than 10
for ext* filesystems), but avoids doing two separate shifts that the
compiler cannot optimize together due to parenthesis and potential side
effects (e.g. this kind of operation could be used to mask off the top
bits, but isn't doing so here).

Cheers, Andreas
-- 
Andreas Dilger

Lustre Software Architect
Intel High Performance Data Division


--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ