linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Satoru Takeuchi <satoru.takeuchi@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: satoru takeuchi <satoru.takeuchi@gmail.com>,
	stable@vger.kernel.org, jack@suse.cz, pbonzini@redhat.com,
	JBottomley@parallels.com,
	linux-scsi@vger.kernel.orgpbonzini@redhat.com, axboe@kernel.dk
Subject: Re: stable-rc test results
Date: Sun, 02 Dec 2012 22:39:25 +0900	[thread overview]
Message-ID: <87624kmv3m.wl%satoru.takeuchi@gmail.com> (raw)
In-Reply-To: <20121129213636.GA357@kroah.com>

At Thu, 29 Nov 2012 13:36:36 -0800,
Greg KH wrote:
> 
> On Thu, Nov 22, 2012 at 11:09:56PM +0900, satoru takeuchi wrote:
> > Hi Greg and all,
> > 
> > I succeeded to build, boot, and run kernel build with the following
> > three stable-rc kernels
> > provided at today.
> > 
> >  - 3.6.8-rc1
> >  - 3.4.20-rc1
> >  - 3.0.53-rc1
> > 
> > There is the following message many times in the dmesg with 3.0.53-rc1.
> > 
> > ====================================================
> > grub-probe: sending ioctl 1261 to a partition!
> > ====================================================
> > 
> > This message can be suppressed by commit 6d9359280. I found 3.0.53-rc1
> > and 3.4.20-rc1 does not contain this commit and this commit is suitable for
> > stable kernels since displaying such message pollutes dmesg, hides many
> > other important kernel message, and incurs user's complain as Jan Kara,
> > the author of this patch, says.
> 
> This patch doesn't apply to 3.0, if you think it's needed there, please
> provide a backported version.

OK, here it is. The following patch can be applied to 3.0.54-rc1.
I confirmed that the kernel with this patch can boot and passed the
upstream kernel build test without any problem. Of course there is no
warnings about ioctl() to partitions.

>From 624e38e47d70456bea252bb2d84bb0185ca38bdd Mon Sep 17 00:00:00 2001
From: Satoru Takeuchi <satoru.takeuchi@gmail.com>
Date: Sun, 2 Dec 2012 21:20:13 +0900
Subject: [PATCH] scsi: Silence unnecessary warnings about ioctl to partition

commit 6d9359280753d2955f86d6411047516a9431eb51 upstream.

[ I modified the upstream patch since the return value of
  scsi_verify_blk_ioctl() is different between 3.0-stable and upstream
  if capable(CAP_SYS_RAWIO) is false.

    - 3.0-stable: -ENOTTY
    - upstream:   -ENOIOCTLCMD

  It comes from that commit 8bd8442 modified this value with respect to
  commit 07d106d.

  The following description is from the upstream patch. ]

Sometimes, warnings about ioctls to partition happen often enough that they
form majority of the warnings in the kernel log and users complain. In some
cases warnings are about ioctls such as SG_IO so it's not good to get rid of
the warnings completely as they can ease debugging of userspace problems
when ioctl is refused.

Since I have seen warnings from lots of commands, including some proprietary
userspace applications, I don't think disallowing the ioctls for processes
with CAP_SYS_RAWIO will happen in the near future if ever. So lets just
stop warning for processes with CAP_SYS_RAWIO for which ioctl is allowed.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: James Bottomley <JBottomley@parallels.com>
CC: linux-scsi@vger.kernel.org
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Jan Kara <jack@suse.cz>
CC: Jens Axboe <axboe@kernel.dk>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 block/scsi_ioctl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 5ef1f4c..055952e 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -722,11 +722,14 @@ int scsi_verify_blk_ioctl(struct block_device *bd, unsigned int cmd)
 		break;
 	}
 
+	if (capable(CAP_SYS_RAWIO))
+		return 0;
+
 	/* In particular, rule out all resets and host-specific ioctls.  */
 	printk_ratelimited(KERN_WARNING
 			   "%s: sending ioctl %x to a partition!\n", current->comm, cmd);
 
-	return capable(CAP_SYS_RAWIO) ? 0 : -ENOTTY;
+	return -ENOTTY;
 }
 EXPORT_SYMBOL(scsi_verify_blk_ioctl);
 
-- 
1.7.2.5

           reply	other threads:[~2012-12-02 13:39 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20121129213636.GA357@kroah.com>]

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=87624kmv3m.wl%satoru.takeuchi@gmail.com \
    --to=satoru.takeuchi@gmail.com \
    --cc=JBottomley@parallels.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack@suse.cz \
    --cc=linux-scsi@vger.kernel.orgpbonzini \
    --cc=pbonzini@redhat.com \
    --cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).