Commit aaf0ef1d authored by M. Mohan Kumar's avatar M. Mohan Kumar Committed by Eric Van Hensbergen
Browse files

9p: use the updated offset given by generic_write_checks



Without this fix, even if a file is opened in O_APPEND mode, data will be
written at current file position instead of end of file.
Signed-off-by: default avatarM. Mohan Kumar <mohan@in.ibm.com>
Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent 316ad550
...@@ -508,9 +508,12 @@ v9fs_file_write(struct file *filp, const char __user * data, ...@@ -508,9 +508,12 @@ v9fs_file_write(struct file *filp, const char __user * data,
if (!count) if (!count)
goto out; goto out;
return v9fs_file_write_internal(filp->f_path.dentry->d_inode, retval = v9fs_file_write_internal(filp->f_path.dentry->d_inode,
filp->private_data, filp->private_data,
data, count, offset, 1); data, count, &origin, 1);
/* update offset on successful write */
if (retval > 0)
*offset = origin;
out: out:
return retval; return retval;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment