linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Steven Haigh <netwiz@crc.id.au>,
	John Robinson <john.robinson@anonymous.org.uk>,
	linux-raid@vger.kernel.org, Jan Kara <jack@suse.cz>
Subject: Re: mdadm: sending ioctl 1261 to a partition!
Date: Thu, 8 Mar 2012 11:04:21 +1100	[thread overview]
Message-ID: <20120308110421.45d337b9@notabene.brown> (raw)
In-Reply-To: <4F55A0D7.4040908@zytor.com>

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

On Mon, 05 Mar 2012 21:29:59 -0800 "H. Peter Anvin" <hpa@zytor.com> wrote:

> On 03/05/2012 06:27 PM, NeilBrown wrote:
> > 
> > So it is still called fsync_bdev and invalidate_bdev as long as the
> > ioctl function for the underlying disk returns -EINVAL or -ENOTTY.
> > 
> > The function that shows that warning is scsi_verify_blk_ioctl in 
> > block/scsi_ioctl.c The worst it can do is return -ENOTTY, and that
> > is safe.
> > 
> > So the warning is bogus, the code still works.
> > 
> 
> We should whitelist ioctls if they are legitimately used and harmless.
>  Do we have a specific list?
> 
> 	-hpa
> 
> 

We had the following in our SLES kernel for a while, though it seems it
disappeared when we pulled in 3.0.18.
Jan: should we put this stuff back?

NeilBrown




@@ -78,11 +83,19 @@ Index: linux-3.0-SLE11-SP2/block/scsi_ioctl.c
 +      case SG_GET_RESERVED_SIZE:
 +      case SG_SET_RESERVED_SIZE:
 +      case SG_EMULATED_HOST:
++      case BLKFLSBUF:
++      case BLKROSET:
 +              return 0;
 +      case CDROM_GET_CAPABILITY:
-+              /* Keep this until we remove the printk below.  udev sends it
-+               * and we do not want to spam dmesg about it.   CD-ROMs do
-+               * not have partitions, so we get here only for disks.
++      case CDROM_DRIVE_STATUS:
++      case FDGETPRM:
++      case RAID_VERSION:
++      case MTIOCGET:
++#ifdef CONFIG_COMPAT
++      case 0x801c6d02:        /* MTIOCGET32 */
++#endif
++              /* Keep this until we remove the printk below. udev/dd sends
++               * these and we do not want to spam dmesg about it. CD-ROMs
++               * & tapes do not have partitions, so we get here only for
++               * disks.
 +               */
 +              return -ENOTTY;
 +      default:


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2012-03-08  0:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 13:03 mdadm: sending ioctl 1261 to a partition! Steven Haigh
2012-03-05 14:52 ` John Robinson
2012-03-05 18:53   ` Steven Haigh
2012-03-05 20:01     ` NeilBrown
2012-03-06  2:00       ` Steven Haigh
2012-03-06  2:27         ` NeilBrown
2012-03-06  2:38           ` Steven Haigh
2012-03-06  5:29           ` H. Peter Anvin
2012-03-08  0:04             ` NeilBrown [this message]
2012-03-08 10:54               ` Jan Kara

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=20120308110421.45d337b9@notabene.brown \
    --to=neilb@suse.de \
    --cc=hpa@zytor.com \
    --cc=jack@suse.cz \
    --cc=john.robinson@anonymous.org.uk \
    --cc=linux-raid@vger.kernel.org \
    --cc=netwiz@crc.id.au \
    /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).