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:	Mon, 24 Sep 2012 16:09:45 -0700
From:	Kent Overstreet <koverstreet@...gle.com>
To:	Jim Paris <jim@...n.com>
Cc:	linux-bcache@...r.kernel.org, linux-kernel@...r.kernel.org,
	dm-devel@...hat.com, tj@...nel.org, axboe@...nel.dk, neilb@...e.de,
	vgoyal@...hat.com, "Ed L. Cashin" <ecashin@...aid.com>,
	Nick Piggin <npiggin@...nel.dk>, Jiri Kosina <jkosina@...e.cz>,
	Geoff Levand <geoff@...radead.org>,
	Alasdair Kergon <agk@...hat.com>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH v3 07/26] block: Use bio_sectors() more consistently

On Mon, Sep 24, 2012 at 07:04:50PM -0400, Jim Paris wrote:
> Kent Overstreet wrote:
> > Bunch of places in the code weren't using it where they could be -
> > this'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx
> > into a struct bvec_iter.
> > 
> > Signed-off-by: Kent Overstreet <koverstreet@...gle.com>
> > CC: Jens Axboe <axboe@...nel.dk>
> > CC: "Ed L. Cashin" <ecashin@...aid.com>
> > CC: Nick Piggin <npiggin@...nel.dk>
> > CC: Jiri Kosina <jkosina@...e.cz>
> > CC: Jim Paris <jim@...n.com>
> > CC: Geoff Levand <geoff@...radead.org>
> > CC: Alasdair Kergon <agk@...hat.com>
> > CC: dm-devel@...hat.com
> > CC: Neil Brown <neilb@...e.de>
> > CC: Steven Rostedt <rostedt@...dmis.org>
> > ---
> >  drivers/block/aoe/aoecmd.c   |  2 +-
> >  drivers/block/brd.c          |  3 +--
> >  drivers/block/pktcdvd.c      |  2 +-
> >  drivers/block/ps3vram.c      |  2 +-
> >  drivers/md/dm-raid1.c        |  2 +-
> >  drivers/md/raid0.c           |  6 +++---
> >  drivers/md/raid1.c           | 17 ++++++++---------
> >  drivers/md/raid10.c          | 24 +++++++++++-------------
> >  drivers/md/raid5.c           |  8 ++++----
> >  include/trace/events/block.h | 10 +++++-----
> >  10 files changed, 36 insertions(+), 40 deletions(-)
> ...
> > diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
> > index f58cdcf..1ff38e8 100644
> > --- a/drivers/block/ps3vram.c
> > +++ b/drivers/block/ps3vram.c
> > @@ -553,7 +553,7 @@ static struct bio *ps3vram_do_bio(struct ps3_system_bus_device *dev,
> >  	struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
> >  	int write = bio_data_dir(bio) == WRITE;
> >  	const char *op = write ? "write" : "read";
> > -	loff_t offset = bio->bi_sector << 9;
> > +	loff_t offset = bio_sectors(bio);
> 
> This doesn't look right to me: bio_sectors(bio) is (bio->bi_size>>9),
> not (bio->bi_sector<<9~)?

Whoops, you're right - that's completely wrong. Thanks.
--
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