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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49D2665A.9090500@panasas.com>
Date:	Tue, 31 Mar 2009 21:52:10 +0300
From:	Benny Halevy <bhalevy@...asas.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	Boaz Harrosh <bharrosh@...asas.com>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	Jeff Garzik <jeff@...zik.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	James Bottomley <James.Bottomley@...senPartnership.com>,
	Avishay Traeger <avishay@...il.com>,
	open-osd <osd-dev@...n-osd.org>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	Evgeniy Polyakov <zbr@...emap.net>
Subject: Re: [osd-dev] [PATCH 6/8] exofs: super_operations and	file_system_type

On Mar. 31, 2009, 11:04 +0300, Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Wed, 18 Mar 2009 20:09:51 +0200 Boaz Harrosh <bharrosh@...asas.com> wrote:
> 
>> This patch ties all operation vectors into a file system superblock
>> and registers the exofs file_system_type at module's load time.
>>
>> * The file system control block (AKA on-disk superblock) resides in
>>   an object with a special ID (defined in common.h).
>>   Information included in the file system control block is used to
>>   fill the in-memory superblock structure at mount time. This object
>>   is created before the file system is used by mkexofs.c It contains
>>   information such as:
>> 	- The file system's magic number
>> 	- The next inode number to be allocated
>>
>>
>> ...
>>
>> +static int exofs_statfs(struct dentry *dentry, struct kstatfs *buf)
>> +{
>> +	struct super_block *sb = dentry->d_sb;
>> +	struct exofs_sb_info *sbi = sb->s_fs_info;
>> +	struct osd_obj_id obj = {sbi->s_pid, 0};
>> +	struct osd_attr attrs[] = {
>> +		ATTR_DEF(OSD_APAGE_PARTITION_QUOTAS,
>> +			OSD_ATTR_PQ_CAPACITY_QUOTA, sizeof(__be64)),
>> +		ATTR_DEF(OSD_APAGE_PARTITION_INFORMATION,
>> +			OSD_ATTR_PI_USED_CAPACITY, sizeof(__be64)),
>> +	};
>> +	uint64_t capacity = ~0;
>> +	uint64_t used = ~0;
> 
> My brain hurts.
> 
> ~0 is signed 0xffffffff.
> 
> When assigning to a u64 it gets signed extended to signed
> 0xffffffffffffffff and then converted to unsigned 0xffffffffffffffff.

Right (I think, I'm not sure in what order)

> 
> I think.  Just as with plain old "-1".  Perhaps using plain old "-1"
> would be clearer here.

or maybe ~0ULL or ~(uint64_t)0 to be extremely anal about it.

Benny

> 
>> ...
>>
>> +const struct super_operations exofs_sops = {
> 
> This can in fact be made static, I believe.
> 
>> ...
>>
> 
> _______________________________________________
> osd-dev mailing list
> osd-dev@...n-osd.org
> http://mailman.open-osd.org/mailman/listinfo/osd-dev
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ