diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 2 | ||||
-rw-r--r-- | block/compat_ioctl.c | 31 | ||||
-rw-r--r-- | block/scsi_ioctl.c | 2 |
3 files changed, 34 insertions, 1 deletions
diff --git a/block/bsg.c b/block/bsg.c index e8bd2475682a..e73e50daf3d0 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -202,6 +202,8 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq, | |||
202 | rq->timeout = q->sg_timeout; | 202 | rq->timeout = q->sg_timeout; |
203 | if (!rq->timeout) | 203 | if (!rq->timeout) |
204 | rq->timeout = BLK_DEFAULT_SG_TIMEOUT; | 204 | rq->timeout = BLK_DEFAULT_SG_TIMEOUT; |
205 | if (rq->timeout < BLK_MIN_SG_TIMEOUT) | ||
206 | rq->timeout = BLK_MIN_SG_TIMEOUT; | ||
205 | 207 | ||
206 | return 0; | 208 | return 0; |
207 | } | 209 | } |
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c index 3d3e7a46f38c..67eb93cff699 100644 --- a/block/compat_ioctl.c +++ b/block/compat_ioctl.c | |||
@@ -677,6 +677,29 @@ static int compat_blkdev_driver_ioctl(struct block_device *bdev, fmode_t mode, | |||
677 | case DVD_WRITE_STRUCT: | 677 | case DVD_WRITE_STRUCT: |
678 | case DVD_AUTH: | 678 | case DVD_AUTH: |
679 | arg = (unsigned long)compat_ptr(arg); | 679 | arg = (unsigned long)compat_ptr(arg); |
680 | /* These intepret arg as an unsigned long, not as a pointer, | ||
681 | * so we must not do compat_ptr() conversion. */ | ||
682 | case HDIO_SET_MULTCOUNT: | ||
683 | case HDIO_SET_UNMASKINTR: | ||
684 | case HDIO_SET_KEEPSETTINGS: | ||
685 | case HDIO_SET_32BIT: | ||
686 | case HDIO_SET_NOWERR: | ||
687 | case HDIO_SET_DMA: | ||
688 | case HDIO_SET_PIO_MODE: | ||
689 | case HDIO_SET_NICE: | ||
690 | case HDIO_SET_WCACHE: | ||
691 | case HDIO_SET_ACOUSTIC: | ||
692 | case HDIO_SET_BUSSTATE: | ||
693 | case HDIO_SET_ADDRESS: | ||
694 | case CDROMEJECT_SW: | ||
695 | case CDROM_SET_OPTIONS: | ||
696 | case CDROM_CLEAR_OPTIONS: | ||
697 | case CDROM_SELECT_SPEED: | ||
698 | case CDROM_SELECT_DISC: | ||
699 | case CDROM_MEDIA_CHANGED: | ||
700 | case CDROM_DRIVE_STATUS: | ||
701 | case CDROM_LOCKDOOR: | ||
702 | case CDROM_DEBUG: | ||
680 | break; | 703 | break; |
681 | default: | 704 | default: |
682 | /* unknown ioctl number */ | 705 | /* unknown ioctl number */ |
@@ -699,8 +722,14 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) | |||
699 | struct backing_dev_info *bdi; | 722 | struct backing_dev_info *bdi; |
700 | loff_t size; | 723 | loff_t size; |
701 | 724 | ||
725 | /* | ||
726 | * O_NDELAY can be altered using fcntl(.., F_SETFL, ..), so we have | ||
727 | * to updated it before every ioctl. | ||
728 | */ | ||
702 | if (file->f_flags & O_NDELAY) | 729 | if (file->f_flags & O_NDELAY) |
703 | mode |= FMODE_NDELAY_NOW; | 730 | mode |= FMODE_NDELAY; |
731 | else | ||
732 | mode &= ~FMODE_NDELAY; | ||
704 | 733 | ||
705 | switch (cmd) { | 734 | switch (cmd) { |
706 | case HDIO_GETGEO: | 735 | case HDIO_GETGEO: |
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 5963cf91a3a0..d0bb92cbefb9 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -208,6 +208,8 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq, | |||
208 | rq->timeout = q->sg_timeout; | 208 | rq->timeout = q->sg_timeout; |
209 | if (!rq->timeout) | 209 | if (!rq->timeout) |
210 | rq->timeout = BLK_DEFAULT_SG_TIMEOUT; | 210 | rq->timeout = BLK_DEFAULT_SG_TIMEOUT; |
211 | if (rq->timeout < BLK_MIN_SG_TIMEOUT) | ||
212 | rq->timeout = BLK_MIN_SG_TIMEOUT; | ||
211 | 213 | ||
212 | return 0; | 214 | return 0; |
213 | } | 215 | } |