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: <49D1EEF4.60404@panasas.com>
Date:	Tue, 31 Mar 2009 13:22:44 +0300
From:	Boaz Harrosh <bharrosh@...asas.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	Avishay Traeger <avishay@...il.com>, Jeff Garzik <jeff@...zik.org>,
	Evgeniy Polyakov <zbr@...emap.net>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	open-osd <osd-dev@...n-osd.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	James Bottomley <James.Bottomley@...senPartnership.com>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Subject: Re: [PATCH 5/8] exofs: dir_inode and directory operations

On 03/31/2009 11:04 AM, Andrew Morton wrote:
> On Wed, 18 Mar 2009 20:08:49 +0200 Boaz Harrosh <bharrosh@...asas.com> wrote:
> 
>> implementation of directory and inode operations.
>>
>> * A directory is treated as a file, and essentially contains a list
>>   of <file name, inode #> pairs for files that are found in that
>>   directory. The object IDs correspond to the files' inode numbers
>>   and are allocated using a 64bit incrementing global counter.
>> * Each file's control block (AKA on-disk inode) is stored in its
>>   object's attributes. This applies to both regular files and other
>>   types (directories, device files, symlinks, etc.).
>>
>>
>> ...
>>
>> +static inline unsigned long dir_pages(struct inode *inode)
>> +{
>> +	return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
>> +}
> 
> Do we need i_size_read() here?  Probably not if it's always called
> under i_mutex.  Needs checking and commenting please.
> 

Don't know, I'll have a look

>> +static unsigned exofs_last_byte(struct inode *inode, unsigned long page_nr)
>> +{
>> +	unsigned last_byte = inode->i_size;
>> +
>> +	last_byte -= page_nr << PAGE_CACHE_SHIFT;
> 
> hm.  Strange to left-shift an unsigned long and then copy it to a
> smaller type.
> 

wrong type, thanks!

> Are the types here appropriately chosen?
> 
>> +	if (last_byte > PAGE_CACHE_SIZE)
>> +		last_byte = PAGE_CACHE_SIZE;
>> +	return last_byte;
>> +}
>> +
>> +static int exofs_commit_chunk(struct page *page, loff_t pos, unsigned len)
>>
>> ...
>>
> 
> This all looks vaguely familiar :)

Yep ;). Don't forget that all this started with a cp ...

Boaz
--
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