Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139752
b: refs/heads/master
c: 10c7db2
h: refs/heads/master
v: v3
  • Loading branch information
Gerd Hoffmann authored and Linus Torvalds committed Apr 3, 2009
1 parent 20f1cd1 commit 65c5f11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ddd9e91b71072b8ebe89311c3a44b077defa1756
refs/heads/master: 10c7db279218eda4b19d29ee17db8a815b18d564
20 changes: 12 additions & 8 deletions trunk/fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,13 +1222,14 @@ compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec,
unsigned long vlen)
{
struct file *file;
int fput_needed;
ssize_t ret;

file = fget(fd);
file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_readv(file, vec, vlen, &file->f_pos);
fput(file);
fput_light(file, fput_needed);
return ret;
}

Expand All @@ -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;
struct file *file;
int fput_needed;
ssize_t ret;

if (pos < 0)
return -EINVAL;
file = fget(fd);
file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_readv(file, vec, vlen, &pos);
fput(file);
fput_light(file, fput_needed);
return ret;
}

Expand Down Expand Up @@ -1277,13 +1279,14 @@ compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec,
unsigned long vlen)
{
struct file *file;
int fput_needed;
ssize_t ret;

file = fget(fd);
file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_writev(file, vec, vlen, &file->f_pos);
fput(file);
fput_light(file, fput_needed);
return ret;
}

Expand All @@ -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;
struct file *file;
int fput_needed;
ssize_t ret;

if (pos < 0)
return -EINVAL;
file = fget(fd);
file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_writev(file, vec, vlen, &pos);
fput(file);
fput_light(file, fput_needed);
return ret;
}

Expand Down

0 comments on commit 65c5f11

Please sign in to comment.