diff options
author | Mike Marshall <hubcap@omnibond.com> | 2015-11-13 13:05:11 -0500 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2015-11-13 13:05:11 -0500 |
commit | 3f1b6947dcfa76de0b690022dcf3ed8814744aa7 (patch) | |
tree | d0c0e42b79ae1b166e5f20be0b27483d7c0d4662 /fs/orangefs/file.c | |
parent | 8092895f759ede31634d0f0fc85a74d970552c49 (diff) | |
download | linux-stable-3f1b6947dcfa76de0b690022dcf3ed8814744aa7.tar.gz linux-stable-3f1b6947dcfa76de0b690022dcf3ed8814744aa7.tar.bz2 linux-stable-3f1b6947dcfa76de0b690022dcf3ed8814744aa7.zip |
Orangefs: set pos after generic_write_checks
if we are appending, generic_write_checks would have updated
pos to the end of the file...
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/file.c')
-rw-r--r-- | fs/orangefs/file.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 78d296bb870e..78a46968a994 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -430,7 +430,7 @@ static ssize_t pvfs2_file_read_iter(struct kiocb *iocb, struct iov_iter *iter) static ssize_t pvfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *iter) { struct file *file = iocb->ki_filp; - loff_t pos = *(&iocb->ki_pos); + loff_t pos; ssize_t rc; BUG_ON(iocb->private); @@ -461,6 +461,13 @@ static ssize_t pvfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *iter) goto out; } + /* + * if we are appending, generic_write_checks would have updated + * pos to the end of the file, so we will wait till now to set + * pos... + */ + pos = *(&iocb->ki_pos); + rc = do_readv_writev(PVFS_IO_WRITE, file, &pos, |