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: <54B5A77C.9040405@nod.at>
Date:	Wed, 14 Jan 2015 00:17:16 +0100
From:	Richard Weinberger <richard@....at>
To:	Jens Axboe <axboe@...com>, Christoph Hellwig <hch@...radead.org>
CC:	dedekind1@...il.com, dwmw2@...radead.org,
	computersforpeace@...il.com, linux-mtd@...ts.infradead.org,
	linux-kernel@...r.kernel.org, tom.leiming@...il.com
Subject: Re: [PATCH 2/2 v2] UBI: Block: Add blk-mq support

Am 13.01.2015 um 23:54 schrieb Jens Axboe:
>>> blk_rq_map_sg returns the number of entries actually mapped, which
>>> might be smaller than the number passed in due to merging.
>>
>> Yep, but the ubi_sql has a fixed number of scatterlist entries, UBI_MAX_SG_COUNT.
>> And I limit it also to that using: blk_queue_max_segments(dev->rq, UBI_MAX_SG_COUNT);
>>
>> Is there another reason why I should use the return value of blk_rq_map_sg()?
>> Please also note that the UBI block driver is read-only.
> 
> It can return less than what you asked for, if segments are coalesced.
> Read/write, doesn't matter. You should always use the returned value as
> the indication of how many segments to access in pdu->usgl.sg for data
> transfer.

Sorry, I don't fully understand.

Currently the driver does:
to_read = blk_rq_bytes(req);
Then it fills pdu->usgl.sg up to to_read bytes
and calls blk_mq_end_request().

If I understand you correctly it can happen that blk_rq_bytes() returns
more bytes than blk_rq_map_sg() allocated, right?

Thanks,
//richard
--
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