linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Viro <viro@math.psu.edu>
To: Christoph Hellwig <hch@infradead.org>
Cc: Joe Thornber <joe@fib011235813.fsnet.co.uk>,
	Linus Torvalds <torvalds@transmeta.com>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@redhat.com>, Jens Axboe <axboe@suse.de>
Subject: Re: Linux v2.5.42
Date: Mon, 14 Oct 2002 15:32:00 -0400 (EDT)	[thread overview]
Message-ID: <Pine.GSO.4.21.0210141524550.6505-100000@weyl.math.psu.edu> (raw)
In-Reply-To: <20021014202158.A27076@infradead.org>



On Mon, 14 Oct 2002, Christoph Hellwig wrote:

> +{
> +	int r;
> +
> +	if (d->bdev)
> +		BUG();
> +
> +	if (!(d->bdev = bdget(kdev_t_to_nr(d->dev))))
> +		return -ENOMEM;
> +
> + 	r = blkdev_get(d->bdev, d->mode, 0, BDEV_RAW);
> +	if (r) {
> +		bdput(d->bdev);

*blam*
failing blkdev_get() does bdput() itself.

> +
> +	if (sscanf(path, "%x:%x", &major, &minor) == 2) {
> +		/* Extract the major/minor numbers */
> +		dev = mk_kdev(major, minor);
> +	} else {
> +		/* convert the path to a device */
> +		if ((r = lookup_device(path, &dev)))
> +			return r;
> +	}
> 
> What do you need the major/minor version for?

... and in any case, both branches should result in struct block_device *
(the former - via bdget(MKDEV(...));)
 
> +	switch (command) {
> +	case BLKGETSIZE:
> +		l_size = (long) size;
> +		if (copy_to_user((void *) a, &l_size, sizeof(long)))
> +			return -EFAULT;
> +		break;

> These two are in generic code and odn't need to be implemented
> by a lowlevel driver (won't ever be called).

Not only that, but BLKGETSIZE above is missing overflow check.
(these two are still called, with generic version called if we
get -EINVAL; with patches submitted to Linus they won't be even
tried).


  reply	other threads:[~2002-10-14 19:26 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-12  4:59 Linux v2.5.42 Linus Torvalds
2002-10-12  5:53 ` Adrian Bunk
2002-10-12  7:23 ` Adrian Bunk
2002-10-12  7:52 ` Andres Salomon
2002-10-12  9:23   ` David S. Miller
2002-10-12  9:11 ` Adrian Bunk
2002-10-12  9:24 ` Adrian Bunk
2002-10-12  9:41   ` Sam Ravnborg
2002-10-12 10:21     ` Adrian Bunk
2002-10-12  9:50 ` Matthias Andree
2002-10-12 11:11   ` jw schultz
2002-10-12 11:29     ` Andres Salomon
2002-10-12 11:46     ` Alan Cox
2002-10-12 11:40       ` jw schultz
2002-10-12 17:47     ` Jon Portnoy
2002-10-12 18:10     ` Rik van Riel
2002-10-13 11:58     ` venom
2002-10-13 12:52       ` Michael Clark
2002-10-12 12:37 ` Ed Tomlinson
2002-10-12 13:32 ` Christoph Hellwig
2002-10-12 19:39   ` Andres Salomon
2002-10-12 13:43 ` Christoph Hellwig
2002-10-13 17:10   ` Dipankar Sarma
2002-10-14 10:01 ` Joe Thornber
2002-10-14 19:21   ` Christoph Hellwig
2002-10-14 19:32     ` Alexander Viro [this message]
2002-10-14 22:28     ` Joe Thornber
2002-10-12 17:14 Mark Peloquin
2002-10-12 19:34 ` Alan Cox
2002-10-12 19:37   ` jbradford
2002-10-13 23:55     ` Rob Landley
2002-10-13 12:41 ` [Evms-devel] " Michael Clark
2002-10-13 13:49   ` Christoph Hellwig
2002-10-13 15:16     ` Michael Clark
2002-10-13 15:35       ` Christoph Hellwig
2002-10-13 16:11         ` Brian Jackson
2002-10-13 16:26           ` Arjan van de Ven
2002-10-13 17:06             ` Brian Jackson
2002-10-13 19:58               ` Mark Hahn
2002-10-13 19:57                 ` Rik van Riel
2002-10-13 20:26                   ` Sean Neakums
2002-10-24 11:45                   ` Alexander Kellett
2002-10-13 19:59                 ` Andrew Morton
2002-10-13 20:24                 ` Bernd Eckenfels
2002-10-14 15:11                   ` Christoph Hellwig
2002-10-14 22:27                     ` Bernd Eckenfels
2002-10-13 17:46           ` Robert Love
2002-10-13 18:34             ` Brian Jackson
2002-10-14 14:45           ` Christoph Hellwig
2002-10-13 13:41 ` Christoph Hellwig
2002-10-12 20:20 Dieter Nützel
2002-10-12 22:19 ` Hans Reiser
2002-10-14 17:37 Ben Rafanello
2002-10-15  2:47 Paul McKenney
2002-10-15 17:43 Mark Peloquin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.21.0210141524550.6505-100000@weyl.math.psu.edu \
    --to=viro@math.psu.edu \
    --cc=alan@redhat.com \
    --cc=axboe@suse.de \
    --cc=hch@infradead.org \
    --cc=joe@fib011235813.fsnet.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).