diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-09-08 05:43:49 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-08 05:43:49 -0400 |
commit | 1d6ae775d7a948c9575658eb41184fd2e506c0df (patch) | |
tree | 8128a28e89d82f13bb8e3a2160382240c66e2816 /drivers/scsi/sg.c | |
parent | 739cdbf1d8f0739b80035b80d69d871e33749b86 (diff) | |
parent | caf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index e822ca0e97cf..b1b69d738d08 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -61,7 +61,7 @@ static int sg_version_num = 30533; /* 2 digits for each component */ | |||
61 | 61 | ||
62 | #ifdef CONFIG_SCSI_PROC_FS | 62 | #ifdef CONFIG_SCSI_PROC_FS |
63 | #include <linux/proc_fs.h> | 63 | #include <linux/proc_fs.h> |
64 | static char *sg_version_date = "20050328"; | 64 | static char *sg_version_date = "20050901"; |
65 | 65 | ||
66 | static int sg_proc_init(void); | 66 | static int sg_proc_init(void); |
67 | static void sg_proc_cleanup(void); | 67 | static void sg_proc_cleanup(void); |
@@ -1027,8 +1027,7 @@ sg_ioctl(struct inode *inode, struct file *filp, | |||
1027 | if (sdp->detached) | 1027 | if (sdp->detached) |
1028 | return -ENODEV; | 1028 | return -ENODEV; |
1029 | if (filp->f_flags & O_NONBLOCK) { | 1029 | if (filp->f_flags & O_NONBLOCK) { |
1030 | if (test_bit(SHOST_RECOVERY, | 1030 | if (sdp->device->host->shost_state == SHOST_RECOVERY) |
1031 | &sdp->device->host->shost_state)) | ||
1032 | return -EBUSY; | 1031 | return -EBUSY; |
1033 | } else if (!scsi_block_when_processing_errors(sdp->device)) | 1032 | } else if (!scsi_block_when_processing_errors(sdp->device)) |
1034 | return -EBUSY; | 1033 | return -EBUSY; |
@@ -1795,12 +1794,12 @@ st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, | |||
1795 | unsigned long uaddr, size_t count, int rw, | 1794 | unsigned long uaddr, size_t count, int rw, |
1796 | unsigned long max_pfn) | 1795 | unsigned long max_pfn) |
1797 | { | 1796 | { |
1797 | unsigned long end = (uaddr + count + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
1798 | unsigned long start = uaddr >> PAGE_SHIFT; | ||
1799 | const int nr_pages = end - start; | ||
1798 | int res, i, j; | 1800 | int res, i, j; |
1799 | unsigned int nr_pages; | ||
1800 | struct page **pages; | 1801 | struct page **pages; |
1801 | 1802 | ||
1802 | nr_pages = ((uaddr & ~PAGE_MASK) + count + ~PAGE_MASK) >> PAGE_SHIFT; | ||
1803 | |||
1804 | /* User attempted Overflow! */ | 1803 | /* User attempted Overflow! */ |
1805 | if ((uaddr + count) < uaddr) | 1804 | if ((uaddr + count) < uaddr) |
1806 | return -EINVAL; | 1805 | return -EINVAL; |