aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dougg@torque.net>2005-09-09 03:18:57 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-09-09 17:37:05 -0400
commit1c8e71d72026ed4c6ba0fdfd7eebd865f4fd1415 (patch)
tree00e9cffc0b33d72a19cb1699d9fa5d32696a5a2b /drivers/scsi/sg.c
parent788ce43aa1ad7158f894b6bb3df8ba2f63794c20 (diff)
[SCSI] sg: do not set VM_IO flag on mmap-ed pages
Further to the problem discussed in this post: http://marc.theaimsgroup.com/?l=linux-scsi&m=112540053711489&w=2 It seems that the sg driver does not need to set the VM_IO flag on pages that it memory maps to the user space since they are not from the IO space. Ahmed Teirelbar <ahmed.teirelbar@adic.com> wants the facility and has tested this patch as I have without adverse effects. The oops protection is still important. Some users really did try and use dio transfers from the sg driver to memory mapped IO space (on a video capture card if my memory serves) during the lk 2.4 series. I'm not sure how successful it was but that will now be politely refused in lk 2.6.13+ . Changelog: - set the page flags for sg's reserved buffer mmap-ed to the user space to VM_RESERVED (rather than VM_RESERVED | VM_IO ) Signed-off-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index b1b69d738d08..9ea4765d1d12 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>
64static char *sg_version_date = "20050901"; 64static char *sg_version_date = "20050908";
65 65
66static int sg_proc_init(void); 66static int sg_proc_init(void);
67static void sg_proc_cleanup(void); 67static void sg_proc_cleanup(void);
@@ -1299,7 +1299,7 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma)
1299 sg_rb_correct4mmap(rsv_schp, 1); /* do only once per fd lifetime */ 1299 sg_rb_correct4mmap(rsv_schp, 1); /* do only once per fd lifetime */
1300 sfp->mmap_called = 1; 1300 sfp->mmap_called = 1;
1301 } 1301 }
1302 vma->vm_flags |= (VM_RESERVED | VM_IO); 1302 vma->vm_flags |= VM_RESERVED;
1303 vma->vm_private_data = sfp; 1303 vma->vm_private_data = sfp;
1304 vma->vm_ops = &sg_mmap_vm_ops; 1304 vma->vm_ops = &sg_mmap_vm_ops;
1305 return 0; 1305 return 0;