WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] xen/blkfront: forward unknown IOCTLs

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/blkfront: forward unknown IOCTLs to scsi_cmd_ioctl() for /dev/sdX
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Sep 2010 02:30:07 -0700
Delivery-date: Wed, 22 Sep 2010 02:30:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1285142186 -3600
# Node ID f5635e334aa5e778a65f01339a63849eb17f6dc3
# Parent  7c7efaea8b54cc05d53ca4a23d9fad0da619bd23
xen/blkfront: forward unknown IOCTLs to scsi_cmd_ioctl() for /dev/sdX

Certain utilities (here: parted) expect certain SCSI IOCTLs (here:
SCSI_IOCTL_GET_IDLUN) to not fail on /dev/sdX devices. Rather than
handling them one-by-one, just forward control to scsi_cmd_ioctl().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/blkfront/blkfront.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff -r 7c7efaea8b54 -r f5635e334aa5 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c   Fri Sep 17 17:00:43 2010 +0100
+++ b/drivers/xen/blkfront/blkfront.c   Wed Sep 22 08:56:26 2010 +0100
@@ -532,6 +532,7 @@ int blkif_ioctl(struct inode *inode, str
 int blkif_ioctl(struct inode *inode, struct file *filep,
                unsigned command, unsigned long argument)
 {
+       struct blkfront_info *info = inode->i_bdev->bd_disk->private_data;
        int i;
 
        DPRINTK_IOCTL("command: 0x%x, argument: 0x%lx, dev: 0x%04x\n",
@@ -567,14 +568,23 @@ int blkif_ioctl(struct inode *inode, str
                return 0;
 
        case CDROM_GET_CAPABILITY: {
-               struct blkfront_info *info =
-                       inode->i_bdev->bd_disk->private_data;
                struct gendisk *gd = info->gd;
                if (gd->flags & GENHD_FL_CD)
                        return 0;
                return -EINVAL;
        }
        default:
+               if (info->mi && info->gd) {
+                       switch (info->mi->major) {
+                       case SCSI_DISK0_MAJOR:
+                       case SCSI_DISK1_MAJOR ... SCSI_DISK7_MAJOR:
+                       case SCSI_DISK8_MAJOR ... SCSI_DISK15_MAJOR:
+                       case SCSI_CDROM_MAJOR:
+                               return scsi_cmd_ioctl(filep, info->gd, command,
+                                                     (void __user *)argument);
+                       }
+               }
+
                /*printk(KERN_ALERT "ioctl %08x not supported by Xen blkdev\n",
                  command);*/
                return -EINVAL; /* same return as native Linux */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/blkfront: forward unknown IOCTLs to scsi_cmd_ioctl() for /dev/sdX, Xen patchbot-linux-2.6.18-xen <=