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:	Thu, 2 Aug 2007 13:31:16 +1000
From:	Neil Brown <neilb@...e.de>
To:	Tejun Heo <htejun@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 025 of 35] Treat rq->hard_nr_sectors as setting an overriding limit in the size of the request

On Thursday August 2, htejun@...il.com wrote:
> 
> This is pretty confusing.  In all other places, bi_size -> #sector
> conversion is done by rounding down but only in blk_rq_bio_prep() it's
> being rounded up.
> 
> Is my following reasoning correct?
> 
> It was okay till now because unaligned requests don't get merged and
> also haven't done partial completions (end_that_request_first with
> partial count)?  So till now, hard_nr_sectors and nr_sectors didn't
> really matter for unaligned requests but now it matters because it's
> considered while iterating over bvecs in rq.

Yes, that reasoning matches mine.

> 
> If so, I think the correct thing to do would be changing bio_sectors()
> to round up first or let block layer measure transfer in bytes not in
> sectors.  I don't think everyone would agree with the latter tho.  I
> (tentatively) think it would be better to represent length in bytes
> tho.  A lot of requests which aren't aligned to 512 bytes pass through
> the block layer and the mismatch can result in subtle bugs.

I suspect that having a byte count in 'struct request' would make
sense too.  However I would rather avoid making that change myself - I
think it would require reading and understanding a lot more code....

I cannot see anything that would go wrong with rounding up bio_sectors
unconditionally, so I think I will take that approach for this patch
series.

Thanks.

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