compat_hdio_ioctl: get rid of set_fs()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 30138384 229b53c9

+6 -9
+6 -9
block/compat_ioctl.c
··· 79 79 static int compat_hdio_ioctl(struct block_device *bdev, fmode_t mode, 80 80 unsigned int cmd, unsigned long arg) 81 81 { 82 - mm_segment_t old_fs = get_fs(); 83 - unsigned long kval; 84 - unsigned int __user *uvp; 82 + unsigned long *__user p; 85 83 int error; 86 84 87 - set_fs(KERNEL_DS); 85 + p = compat_alloc_user_space(sizeof(unsigned long)); 88 86 error = __blkdev_driver_ioctl(bdev, mode, 89 - cmd, (unsigned long)(&kval)); 90 - set_fs(old_fs); 91 - 87 + cmd, (unsigned long)p); 92 88 if (error == 0) { 93 - uvp = compat_ptr(arg); 94 - if (put_user(kval, uvp)) 89 + unsigned int __user *uvp = compat_ptr(arg); 90 + unsigned long v; 91 + if (get_user(v, p) || put_user(v, uvp)) 95 92 error = -EFAULT; 96 93 } 97 94 return error;