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: <4A307771.10303@ct.jp.nec.com>
Date:	Thu, 11 Jun 2009 12:18:09 +0900
From:	Kiyoshi Ueda <k-ueda@...jp.nec.com>
To:	Boaz Harrosh <bharrosh@...asas.com>
CC:	Tejun Heo <tj@...nel.org>, Jens Axboe <jens.axboe@...cle.com>,
	linux-kernel@...r.kernel.org,
	device-mapper development <dm-devel@...hat.com>,
	"Jun'ichi Nomura" <j-nomura@...jp.nec.com>, k-ueda@...jp.nec.com
Subject: Re: [PATCH block#for-2.6.31] block: add request clone interface

Hi Boaz,

On 06/10/2009 04:55 PM +0900, Boaz Harrosh wrote:
> On 06/10/2009 05:15 AM, Kiyoshi Ueda wrote:
>> On 06/10/2009 03:03 AM +0900, Jens Axboe wrote:
>>> On Tue, Jun 09 2009, Kiyoshi Ueda wrote:
>>>> Hi Jens,
>>>>
>>>> +/*
>>>> + * Copy request information of the original request to the clone request.
>>>> + */
>>>> +static void __blk_rq_prep_clone(struct request *dst, struct request *src)
>>>> +{
>>>> +	dst->cpu = src->cpu;
>>>> +	dst->cmd_flags = (rq_data_dir(src) | REQ_NOMERGE);
>>>> +	dst->cmd_type = src->cmd_type;
>>>> +	dst->__sector = blk_rq_pos(src);
>>>> +	dst->__data_len = blk_rq_bytes(src);
>>>> +	dst->nr_phys_segments = src->nr_phys_segments;
>>>> +	dst->ioprio = src->ioprio;
>>>> +	dst->buffer = src->buffer;
>>>> +	dst->cmd_len = src->cmd_len;
>>>> +	dst->cmd = src->cmd;
>>> Are you making sure that 'src' always exists while 'dst' is alive?
>> Yes.
>> Request-based dm is the owner of 'src' (original) and
>> it never frees 'src' until the 'dst' (clone) are completed.
>>
>> I avoided deep-copying __cmd/buffer/sense as it's costly
>> (additional allocation and memcpy).
> 
> For my needs for example dst->cmd will be different then
> src->cmd. Could be untouched. The caller will set what he
> needs.
> 
> dst->sense should be untouched, caller can set to src->sense
> if he wants to. Or like me he already have another buffer.
> 
> dst->buffer is always NULL in my path so I don't know
> what that is. Tejun?
> 
> It should only be about bios and lengths.
> 
> And a big fat comment about what it does and what it
> does not.

OK, I removed ->cmd, ->sense and ->buffer from __blk_rq_prep_clone()
and added some documents.
Please see the updated patch:
    http://marc.info/?l=dm-devel&m=124468991432260&w=2

Thanks,
Kiyoshi Ueda
--
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