diff options
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 66075a4ad979..39da1c2efa50 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -601,7 +601,7 @@ ceph_sync_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
601 | false); | 601 | false); |
602 | if (IS_ERR(req)) { | 602 | if (IS_ERR(req)) { |
603 | ret = PTR_ERR(req); | 603 | ret = PTR_ERR(req); |
604 | goto out; | 604 | break; |
605 | } | 605 | } |
606 | 606 | ||
607 | num_pages = calc_pages_for(page_align, len); | 607 | num_pages = calc_pages_for(page_align, len); |
@@ -719,7 +719,7 @@ static ssize_t ceph_sync_write(struct kiocb *iocb, const struct iovec *iov, | |||
719 | false); | 719 | false); |
720 | if (IS_ERR(req)) { | 720 | if (IS_ERR(req)) { |
721 | ret = PTR_ERR(req); | 721 | ret = PTR_ERR(req); |
722 | goto out; | 722 | break; |
723 | } | 723 | } |
724 | 724 | ||
725 | /* | 725 | /* |
@@ -972,6 +972,7 @@ retry_snap: | |||
972 | } | 972 | } |
973 | } else { | 973 | } else { |
974 | loff_t old_size = inode->i_size; | 974 | loff_t old_size = inode->i_size; |
975 | struct iov_iter from; | ||
975 | /* | 976 | /* |
976 | * No need to acquire the i_truncate_mutex. Because | 977 | * No need to acquire the i_truncate_mutex. Because |
977 | * the MDS revokes Fwb caps before sending truncate | 978 | * the MDS revokes Fwb caps before sending truncate |
@@ -979,9 +980,10 @@ retry_snap: | |||
979 | * are pending vmtruncate. So write and vmtruncate | 980 | * are pending vmtruncate. So write and vmtruncate |
980 | * can not run at the same time | 981 | * can not run at the same time |
981 | */ | 982 | */ |
982 | written = generic_file_buffered_write(iocb, iov, nr_segs, | 983 | iov_iter_init(&from, iov, nr_segs, count, 0); |
983 | pos, &iocb->ki_pos, | 984 | written = generic_perform_write(file, &from, pos); |
984 | count, 0); | 985 | if (likely(written >= 0)) |
986 | iocb->ki_pos = pos + written; | ||
985 | if (inode->i_size > old_size) | 987 | if (inode->i_size > old_size) |
986 | ceph_fscache_update_objectsize(inode); | 988 | ceph_fscache_update_objectsize(inode); |
987 | mutex_unlock(&inode->i_mutex); | 989 | mutex_unlock(&inode->i_mutex); |