|
@@ -1222,13 +1222,14 @@ compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec,
|
|
unsigned long vlen)
|
|
unsigned long vlen)
|
|
{
|
|
{
|
|
struct file *file;
|
|
struct file *file;
|
|
|
|
+ int fput_needed;
|
|
ssize_t ret;
|
|
ssize_t ret;
|
|
|
|
|
|
- file = fget(fd);
|
|
|
|
|
|
+ file = fget_light(fd, &fput_needed);
|
|
if (!file)
|
|
if (!file)
|
|
return -EBADF;
|
|
return -EBADF;
|
|
ret = compat_readv(file, vec, vlen, &file->f_pos);
|
|
ret = compat_readv(file, vec, vlen, &file->f_pos);
|
|
- fput(file);
|
|
|
|
|
|
+ fput_light(file, fput_needed);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1238,15 +1239,16 @@ compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec,
|
|
{
|
|
{
|
|
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
|
|
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
|
|
struct file *file;
|
|
struct file *file;
|
|
|
|
+ int fput_needed;
|
|
ssize_t ret;
|
|
ssize_t ret;
|
|
|
|
|
|
if (pos < 0)
|
|
if (pos < 0)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
- file = fget(fd);
|
|
|
|
|
|
+ file = fget_light(fd, &fput_needed);
|
|
if (!file)
|
|
if (!file)
|
|
return -EBADF;
|
|
return -EBADF;
|
|
ret = compat_readv(file, vec, vlen, &pos);
|
|
ret = compat_readv(file, vec, vlen, &pos);
|
|
- fput(file);
|
|
|
|
|
|
+ fput_light(file, fput_needed);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1277,13 +1279,14 @@ compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec,
|
|
unsigned long vlen)
|
|
unsigned long vlen)
|
|
{
|
|
{
|
|
struct file *file;
|
|
struct file *file;
|
|
|
|
+ int fput_needed;
|
|
ssize_t ret;
|
|
ssize_t ret;
|
|
|
|
|
|
- file = fget(fd);
|
|
|
|
|
|
+ file = fget_light(fd, &fput_needed);
|
|
if (!file)
|
|
if (!file)
|
|
return -EBADF;
|
|
return -EBADF;
|
|
ret = compat_writev(file, vec, vlen, &file->f_pos);
|
|
ret = compat_writev(file, vec, vlen, &file->f_pos);
|
|
- fput(file);
|
|
|
|
|
|
+ fput_light(file, fput_needed);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1293,15 +1296,16 @@ compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec,
|
|
{
|
|
{
|
|
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
|
|
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
|
|
struct file *file;
|
|
struct file *file;
|
|
|
|
+ int fput_needed;
|
|
ssize_t ret;
|
|
ssize_t ret;
|
|
|
|
|
|
if (pos < 0)
|
|
if (pos < 0)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
- file = fget(fd);
|
|
|
|
|
|
+ file = fget_light(fd, &fput_needed);
|
|
if (!file)
|
|
if (!file)
|
|
return -EBADF;
|
|
return -EBADF;
|
|
ret = compat_writev(file, vec, vlen, &pos);
|
|
ret = compat_writev(file, vec, vlen, &pos);
|
|
- fput(file);
|
|
|
|
|
|
+ fput_light(file, fput_needed);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|