mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
To: Willy Tarreau <willy@w.ods.org>
Cc: Greg K-H <greg@kroah.com>, linux-kernel@vger.kernel.org, sct@redhat.com
Subject: Re: [PATCH] Fix root hole in raw device
Date: Tue, 17 May 2005 08:32:28 +0100	[thread overview]
Message-ID: <20050517073228.GR1150@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20050517070305.GA31135@alpha.home.local>

On Tue, May 17, 2005 at 09:03:05AM +0200, Willy Tarreau wrote:
> On Tue, May 17, 2005 at 05:57:48AM +0100, Al Viro wrote:
> > On Mon, May 16, 2005 at 09:37:48PM -0700, Greg KH wrote:
> > > @@ -122,7 +122,7 @@
> > >  {
> > >  	struct block_device *bdev = filp->private_data;
> > >  
> > > -	return ioctl_by_bdev(bdev, command, arg);
> > > +	return blkdev_ioctl(bdev->bd_inode, filp, command, arg);
> > >  }
> > 
> > That is not quite correct.  You are passing very odd filp to ->ioctl()...
> > Old variant gave NULL, which is also not too nice, though.
> 
> 2.4 already does it in a cleaner manner :
> 
>         err = -EINVAL;
>         if (b && b->bd_inode && b->bd_op && b->bd_op->ioctl) {
>                 err = b->bd_op->ioctl(b->bd_inode, NULL, command, arg);
>         }
>         return err;
> 
> So may be something like this would be better (hand-written) :

> +	if (bdev && bdev->bd_inode)
> +		err = blkdev_ioctl(bdev->bd_inode, filp, command, arg);
> +	return err;

Huh?  These checks are useless and you are still passing a struct file *
that has nothing to do with what ->ioctl() expects.

  parent reply	other threads:[~2005-05-17  7:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-17  4:37 [GIT PATCH] Stable bugfixes for 2.6.12-rc4 Greg KH
2005-05-17  4:37 ` [PATCH] fix Linux kernel ELF core dump privilege elevation Greg KH
2005-05-17  4:37   ` [PATCH] Fix root hole in raw device Greg KH
2005-05-17  4:37     ` [PATCH] Fix root hole in pktcdvd Greg KH
2005-05-17  5:00       ` Al Viro
2005-05-17  5:54         ` Al Viro
2005-05-17 18:12           ` Peter Osterlund
2005-05-17 15:35         ` Greg KH
2005-05-17  4:57     ` [PATCH] Fix root hole in raw device Al Viro
2005-05-17  7:03       ` Willy Tarreau
2005-05-17  7:07         ` Willy Tarreau
2005-05-17  7:38           ` Al Viro
2005-05-17  7:32         ` Al Viro [this message]
2005-05-17 13:04       ` Stephen C. Tweedie
2005-05-17 16:53         ` Al Viro
2005-05-22 11:55           ` Peter Osterlund
2005-05-22 11:57             ` Peter Osterlund

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=20050517073228.GR1150@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sct@redhat.com \
    --cc=willy@w.ods.org \
    /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

Powered by JetHome