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: <49FCF539.2060408@kernel.org>
Date:	Sun, 03 May 2009 10:36:57 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Boaz Harrosh <bharrosh@...asas.com>
CC:	axboe@...nel.dk, linux-kernel@...r.kernel.org, jeff@...zik.org,
	linux-ide@...r.kernel.org, James.Bottomley@...senPartnership.com,
	linux-scsi@...r.kernel.org, bzolnier@...il.com,
	petkovbb@...glemail.com, sshtylyov@...mvista.com,
	mike.miller@...com, chirag.kantharia@...com, Eric.Moore@....com,
	stern@...land.harvard.edu, fujita.tomonori@....ntt.co.jp,
	zaitcev@...hat.com, Geert.Uytterhoeven@...ycom.com,
	sfr@...b.auug.org.au, grant.likely@...retlab.ca,
	paul.clements@...eleye.com, jesper.juhl@...il.com,
	tim@...erelk.net, jeremy@...source.com, adrian@...en.demon.co.uk,
	oakad@...oo.com, dwmw2@...radead.org, schwidefsky@...ibm.com,
	ballabio_dario@....com, davem@...emloft.net, rusty@...tcorp.com.au,
	Markus.Lidel@...dowconnect.com,
	"Darrick J. Wong" <djwong@...ibm.com>
Subject: Re: [PATCH 08/10] block: cleanup rq->data_len usages

Hello, Boaz.

Boaz Harrosh wrote:
>>  	/* The req and req->next_rq have not been completed */
>> -	BUG_ON(blk_end_bidi_request(req, 0, dlen, next_dlen));
>> +	BUG_ON(blk_end_bidi_request(req, 0, blk_rq_bytes(req),
>> +				    blk_rq_bytes(req->next_rq)));
>>  
> 
> Just blk_end_request_all() actually. If you let blk_end_request_all
> also do bidi

I wrote in the other reply but I don't want to make any other change
than converting direct accesses to accessors in this patch, so that we
can _know_ this patch is safe.  Patches in this series are already all
over the place.  But, yeah, cleaning this up would be great.  Care to
send a patch?

>>  	scsi_release_buffers(cmd);
>>  
> 
> and then it can be in-lined into caller, where blk_pc_request(req)
> just do blk_end_request_all regardless (and only the residual
> setting is conditional)
> 
> I'll send a patch to scsi_lib later once this settles a bit.

Ah.. cool.  :-)

>> @@ -966,7 +965,7 @@ static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer *sdb,
>>  	BUG_ON(count > sdb->table.nents);
>>  	sdb->table.nents = count;
>>  	if (blk_pc_request(req))
>> -		sdb->length = req->data_len;
>> +		sdb->length = blk_rq_bytes(req);
>>  	else
>>  		sdb->length = blk_rq_sectors(req) << 9;
> 
> Is this true. I thought they must be the same now. I was actually
> anticipating this if() removed.

Replied in the other reply.

>>  	/* FIXME: should be include in osd_sense_info */
>>  	if (in_resid)
>> -		*in_resid = or->in.req ? or->in.req->data_len : 0;
>> +		*in_resid = or->in.req ? blk_rq_bytes(or->in.req) : 0;
> 
> +		*in_resid = or->in.req ? or->in.req->resid_len : 0;
> 
>>  
>>  	if (out_resid)
>> -		*out_resid = or->out.req ? or->out.req->data_len : 0;
>> +		*out_resid = or->out.req ? blk_rq_bytes(or->out.req) : 0;
> 
> +		*out_resid = or->out.req ? or->out.req->resid_len : 0;
> 
>>  
>>  	return ret;
>>  }
> 
> OK This segment is wrong. It should be moved to the residual count patch
> (PATCH 3/10) the assignment into *in_resid/*out_resid should shourly triggered
> a warning ;-)

Ah... thanks a lot for spotting it.  Will fix.

Thanks.

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