summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-04-13 17:16:59 -0400
committerSteve French <sfrench@us.ibm.com>2012-04-19 22:16:33 -0500
commit3af9d8f227a31e25b3110ef175d105798fc147a6 (patch)
tree0431c865502651114d43d5635802a2f949a55a7e /fs
parentc6f5c93098f5577210f8f3ea22209b3f266c66af (diff)
downloadlinux-3.10-3af9d8f227a31e25b3110ef175d105798fc147a6.tar.gz
linux-3.10-3af9d8f227a31e25b3110ef175d105798fc147a6.tar.bz2
linux-3.10-3af9d8f227a31e25b3110ef175d105798fc147a6.zip
cifs: fix offset handling in cifs_iovec_write
In the recent update of the cifs_iovec_write code to use async writes, the handling of the file position was broken. That patch added a local "offset" variable to handle the offset, and then only updated the original "*poffset" before exiting. Unfortunately, it copied off the original offset from the beginning, instead of doing so after generic_write_checks had been called. Fix this by moving the initialization of "offset" after that in the function. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index fae765dac93..81725e9286e 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2178,7 +2178,7 @@ cifs_iovec_write(struct file *file, const struct iovec *iov,
unsigned long nr_pages, i;
size_t copied, len, cur_len;
ssize_t total_written = 0;
- loff_t offset = *poffset;
+ loff_t offset;
struct iov_iter it;
struct cifsFileInfo *open_file;
struct cifs_tcon *tcon;
@@ -2200,6 +2200,7 @@ cifs_iovec_write(struct file *file, const struct iovec *iov,
cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
open_file = file->private_data;
tcon = tlink_tcon(open_file->tlink);
+ offset = *poffset;
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
pid = open_file->pid;