aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/compat.c')
-rw-r--r--fs/compat.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/compat.c b/fs/compat.c
index 6161255fac45..1bdb350ea5d3 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1155,11 +1155,14 @@ compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec,
1155 struct file *file; 1155 struct file *file;
1156 int fput_needed; 1156 int fput_needed;
1157 ssize_t ret; 1157 ssize_t ret;
1158 loff_t pos;
1158 1159
1159 file = fget_light(fd, &fput_needed); 1160 file = fget_light(fd, &fput_needed);
1160 if (!file) 1161 if (!file)
1161 return -EBADF; 1162 return -EBADF;
1162 ret = compat_readv(file, vec, vlen, &file->f_pos); 1163 pos = file->f_pos;
1164 ret = compat_readv(file, vec, vlen, &pos);
1165 file->f_pos = pos;
1163 fput_light(file, fput_needed); 1166 fput_light(file, fput_needed);
1164 return ret; 1167 return ret;
1165} 1168}
@@ -1221,11 +1224,14 @@ compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec,
1221 struct file *file; 1224 struct file *file;
1222 int fput_needed; 1225 int fput_needed;
1223 ssize_t ret; 1226 ssize_t ret;
1227 loff_t pos;
1224 1228
1225 file = fget_light(fd, &fput_needed); 1229 file = fget_light(fd, &fput_needed);
1226 if (!file) 1230 if (!file)
1227 return -EBADF; 1231 return -EBADF;
1228 ret = compat_writev(file, vec, vlen, &file->f_pos); 1232 pos = file->f_pos;
1233 ret = compat_writev(file, vec, vlen, &pos);
1234 file->f_pos = pos;
1229 fput_light(file, fput_needed); 1235 fput_light(file, fput_needed);
1230 return ret; 1236 return ret;
1231} 1237}