diff options
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/file.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index c66d4b436437..2eb02f80a0ab 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -537,7 +537,7 @@ static void ceph_sync_write_unsafe(struct ceph_osd_request *req, bool unsafe) | |||
537 | * objects, rollback on failure, etc.) | 537 | * objects, rollback on failure, etc.) |
538 | */ | 538 | */ |
539 | static ssize_t | 539 | static ssize_t |
540 | ceph_sync_direct_write(struct kiocb *iocb, struct iov_iter *from) | 540 | ceph_sync_direct_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos) |
541 | { | 541 | { |
542 | struct file *file = iocb->ki_filp; | 542 | struct file *file = iocb->ki_filp; |
543 | struct inode *inode = file_inode(file); | 543 | struct inode *inode = file_inode(file); |
@@ -553,7 +553,6 @@ ceph_sync_direct_write(struct kiocb *iocb, struct iov_iter *from) | |||
553 | int check_caps = 0; | 553 | int check_caps = 0; |
554 | int ret; | 554 | int ret; |
555 | struct timespec mtime = CURRENT_TIME; | 555 | struct timespec mtime = CURRENT_TIME; |
556 | loff_t pos = iocb->ki_pos; | ||
557 | size_t count = iov_iter_count(from); | 556 | size_t count = iov_iter_count(from); |
558 | 557 | ||
559 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) | 558 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) |
@@ -652,7 +651,8 @@ ceph_sync_direct_write(struct kiocb *iocb, struct iov_iter *from) | |||
652 | * correct atomic write, we should e.g. take write locks on all | 651 | * correct atomic write, we should e.g. take write locks on all |
653 | * objects, rollback on failure, etc.) | 652 | * objects, rollback on failure, etc.) |
654 | */ | 653 | */ |
655 | static ssize_t ceph_sync_write(struct kiocb *iocb, struct iov_iter *from) | 654 | static ssize_t |
655 | ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos) | ||
656 | { | 656 | { |
657 | struct file *file = iocb->ki_filp; | 657 | struct file *file = iocb->ki_filp; |
658 | struct inode *inode = file_inode(file); | 658 | struct inode *inode = file_inode(file); |
@@ -669,7 +669,6 @@ static ssize_t ceph_sync_write(struct kiocb *iocb, struct iov_iter *from) | |||
669 | int check_caps = 0; | 669 | int check_caps = 0; |
670 | int ret; | 670 | int ret; |
671 | struct timespec mtime = CURRENT_TIME; | 671 | struct timespec mtime = CURRENT_TIME; |
672 | loff_t pos = iocb->ki_pos; | ||
673 | size_t count = iov_iter_count(from); | 672 | size_t count = iov_iter_count(from); |
674 | 673 | ||
675 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) | 674 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) |
@@ -924,9 +923,9 @@ retry_snap: | |||
924 | /* we might need to revert back to that point */ | 923 | /* we might need to revert back to that point */ |
925 | data = *from; | 924 | data = *from; |
926 | if (file->f_flags & O_DIRECT) | 925 | if (file->f_flags & O_DIRECT) |
927 | written = ceph_sync_direct_write(iocb, &data); | 926 | written = ceph_sync_direct_write(iocb, &data, pos); |
928 | else | 927 | else |
929 | written = ceph_sync_write(iocb, &data); | 928 | written = ceph_sync_write(iocb, &data, pos); |
930 | if (written == -EOLDSNAPC) { | 929 | if (written == -EOLDSNAPC) { |
931 | dout("aio_write %p %llx.%llx %llu~%u" | 930 | dout("aio_write %p %llx.%llx %llu~%u" |
932 | "got EOLDSNAPC, retrying\n", | 931 | "got EOLDSNAPC, retrying\n", |