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:	Sun, 22 Mar 2009 12:41:23 +0200
From:	Boaz Harrosh <bharrosh@...asas.com>
To:	Marcin Slusarz <marcin.slusarz@...il.com>
CC:	Avishay Traeger <avishay@...il.com>, Jeff Garzik <jeff@...zik.org>,
	Andrew Morton <akpm@...ux-foundation.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 4/8] exofs: address_space_operations

Marcin Slusarz wrote:
> Boaz Harrosh wrote:
>> (...)
>> +struct page_collect {
>> +	struct exofs_sb_info *sbi;
>> +	struct request_queue *req_q;
>> +	struct inode *inode;
>> +	unsigned expected_pages;
>> +
>> +	struct bio *bio;
>> +	unsigned nr_pages;
>> +	unsigned long length;
>> +	long pg_first;
>> +};
>> (...)
>> +int pcol_try_alloc(struct page_collect *pcol)
>> +{
>> +	int pages = min_t(unsigned, pcol->expected_pages, BIO_MAX_PAGES);
>> +
>> +	for (; pages; pages >>= 1) {
>> +		pcol->bio = bio_alloc(GFP_KERNEL, pages);
>> +		if (likely(pcol->bio))
>> +			return 0;
>> +	}
>> +
>> +	EXOFS_ERR("Failed to kcalloc expected_pages=%d\n",
> 
> %u
> 
>> +		  pcol->expected_pages);
>> +	return -ENOMEM;
>> +}
>> +
>> (...)
>> +static int __readpages_done(struct osd_request *or, struct page_collect *pcol,
>> +			    bool do_unlock)
>> +{
>> +	struct bio_vec *bvec;
>> +	int i;
>> +	u64 resid;
>> +	u64 good_bytes;
>> +	u64 length = 0;
>> +	int ret = exofs_check_ok_resid(or, &resid, NULL);
>> +
>> +	osd_end_request(or);
>> +
>> +	if (!ret)
>> +		good_bytes = pcol->length;
>> +	else if (ret && !resid)
>> +		good_bytes = 0;
>> +	else
>> +		good_bytes = pcol->length - resid;
> 
> Second ret check is not needed.
> 
>> (...)
>> +
>> +int read_exec(struct page_collect *pcol, bool is_sync)
> 
> read_exec is too generic name for globally visible symbol
> 
>> +{
>> (...)
>> +static void writepages_done(struct osd_request *or, void *p)
>> +{
>> +	struct page_collect *pcol = p;
>> +	struct bio_vec *bvec;
>> +	int i;
>> +	u64 resid;
>> +	u64  good_bytes;
>> +	u64  length = 0;
>> +
>> +	int ret = exofs_check_ok_resid(or, NULL, &resid);
>> +
>> +	osd_end_request(or);
>> +	atomic_dec(&pcol->sbi->s_curr_pending);
>> +
>> +	if (likely(!ret))
>> +		good_bytes = pcol->length;
>> +	else if (ret && !resid)
>> +		good_bytes = 0;
>> +	else
>> +		good_bytes = pcol->length - resid;
> 
> Ret check again.
> 
>> (...)
>> +
>> +int write_exec(struct page_collect *pcol)
> 
> Too generic name.
> 
>> (...)
> 

Right on all accounts. Thanks
will repost

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