projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac534ff
)
nfsd: fix bad offset use
author
Kent Overstreet
<
[email protected]
>
Fri, 22 Mar 2013 18:18:24 +0000
(11:18 -0700)
committer
J. Bruce Fields
<
[email protected]
>
Fri, 22 Mar 2013 20:55:15 +0000
(16:55 -0400)
vfs_writev() updates the offset argument - but the code then passes the
offset to vfs_fsync_range(). Since offset now points to the offset after
what was just written, this is probably not what was intended
Introduced by
face15025ffdf664de95e86ae831544154d26c9c
"nfsd: use
vfs_fsync_range(), not O_SYNC, for stable writes".
Signed-off-by: Kent Overstreet <
[email protected]
>
Cc: Al Viro <
[email protected]
>
Cc: "Eric W. Biederman" <
[email protected]
>
Cc:
[email protected]
Reviewed-by: Zach Brown <
[email protected]
>
Signed-off-by: J. Bruce Fields <
[email protected]
>
fs/nfsd/vfs.c
patch
|
blob
|
history
diff --git
a/fs/nfsd/vfs.c
b/fs/nfsd/vfs.c
index 2a7eb536de0bec80dfbfd7d981139f2e925e644e..2b2e2396a86913b4d4e69c376852ded82dd9be3a 100644
(file)
--- a/
fs/nfsd/vfs.c
+++ b/
fs/nfsd/vfs.c
@@
-1013,6
+1013,7
@@
nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
int host_err;
int stable = *stablep;
int use_wgather;
+ loff_t pos = offset;
dentry = file->f_path.dentry;
inode = dentry->d_inode;
@@
-1025,7
+1026,7
@@
nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
/* Write the data. */
oldfs = get_fs(); set_fs(KERNEL_DS);
- host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &
offset
);
+ host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &
pos
);
set_fs(oldfs);
if (host_err < 0)
goto out_nfserr;