fs/9p: Use updated offset for writing
Subsystems (2)
PATCH 1/1 fs/9p: Use updated offset for writing
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.
--- fs/9p/vfs_file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/9p/vfs_file.c +1 -1
@@ -510,7 +510,7 @@ v9fs_file_write(struct file *filp, const char __user * data,return v9fs_file_write_internal (filp->f_path.dentry->d_inode, filp->private_data, - data, count, offset,1 ); + data, count, &origin,1 ); out:return retval; }
Signature · 1 line
1.7.3.4
Quoted 14 lines · M. Mohan Kumar
Use the updated offset given by
generic_write_checks. Without this fix, even if a file is opened inO_APPENDmode, data will be written at current file position instead of end of file.Signed-off-by M. Mohan Kumar <[email protected]>--- fs/9p/vfs_file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)fs/9p/vfs_file.c +0
-0
fs/9p/vfs_file.c v9fs_file_write(struct file *filp, const char __user * data, · line 516
Quoted 8 lines
fs/9p/vfs_file.c +1
-1@@ -510,7 +510,7 @@ v9fs_file_write(struct file *filp, const char __user * data,return v9fs_file_write_internal (filp->f_path.dentry->d_inode, filp->private_data, - data, count, offset,1 ); + data, count, &origin,1 ); out:return retval; }
You should also update offset on success.
-aneesh
Quoted 1 line · Aneesh Kumar K. V
On Wed, 16 Mar 2011 10:39:16 +0530, "M. Mohan Kumar" <[email protected]>
Quoted 6 lines · wrote:
Quoted 3 lines
Use the updated offset given by
generic_write_checks. Without this fix, even if a file is opened inO_APPENDmode, data will be written at current file position instead of end of file.You should also update offset on success.
Thanks Aneesh, I will send a updated patch.
----
M. Mohan Kumar