]> git.hungrycats.org Git - linux/commitdiff
Don't claim exclusive ownership of the device when doing
authorLinus Torvalds <torvalds@home.osdl.org>
Mon, 1 Sep 2003 05:24:11 +0000 (22:24 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 1 Sep 2003 05:24:11 +0000 (22:24 -0700)
the SG_IO and SCSI_IOCTL_SEND_COMMAND ioctl's. That just
screws things up when the drive is mounted.

If somebody wants exclusive access, he should indicate that
at open time.

drivers/block/scsi_ioctl.c

index ea340cc89bd4784590f17ce433300368d3262318..94574b14f30bd531fae99169f642b68ef50bae17 100644 (file)
@@ -438,11 +438,7 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar
                        err = sg_emulated_host(q, (int *) arg);
                        break;
                case SG_IO:
-                       err = bd_claim(bdev, current);
-                       if (err)
-                               break;
                        err = sg_io(q, bdev, (struct sg_io_hdr *) arg);
-                       bd_release(bdev);
                        break;
                /*
                 * old junk scsi send command ioctl
@@ -452,11 +448,7 @@ int scsi_cmd_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long ar
                        if (!arg)
                                break;
 
-                       err = bd_claim(bdev, current);
-                       if (err)
-                               break;
                        err = sg_scsi_ioctl(q, bdev, (Scsi_Ioctl_Command *)arg);
-                       bd_release(bdev);
                        break;
                case CDROMCLOSETRAY:
                        close = 1;