提交 aaf0ef1d 编写于 作者: M M. Mohan Kumar 提交者: Eric Van Hensbergen

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: NM. Mohan Kumar <mohan@in.ibm.com>
Reviewed-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
上级 316ad550
......@@ -508,9 +508,12 @@ v9fs_file_write(struct file *filp, const char __user * data,
if (!count)
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,
data, count, offset, 1);
data, count, &origin, 1);
/* update offset on successful write */
if (retval > 0)
*offset = origin;
out:
return retval;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册