fs/9p: Use updated offset for writing
Subsystems (2)
PATCH v2 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 | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
fs/9p/vfs_file.c +5 -2
@@ -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; }
Signature · 1 line
1.7.3.4
Quoted 5 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]>
Eric,
I guess this should go in this merge window ?
Quoted 23 lines
--- fs/9p/vfs_file.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)fs/9p/vfs_file.c +5
-2@@ -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; }
Yeah, probably a good idea, if we don't make it in time these are actually fixes so we can bring them in during -rc1.
Quoted 38 lines · Aneesh Kumar K. V
Quoted 5 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]>Reviewed-by Aneesh Kumar K.V <[email protected]>Eric,
I guess this should go in this merge window ?
Quoted 20 lines
---
fs/9p/vfs_file.c | 7 +++++--1 files changed, 5 insertions(+), 2 deletions(-)fs/9p/vfs_file.c +5
-2@@ -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;Quoted 3 lines
out:
return retval;
}------------------------------------------------------------------------------
Quoted 9 lines
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
V9fs-developer mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/v9fs-developer
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html