diff options
author | Yunchuan Wen <yunchuanwen@ubuntukylin.com> | 2013-12-26 09:29:27 -0500 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2014-04-02 22:33:53 -0400 |
commit | 32d3e148ddac0087fdd8499ce4075db20518e122 (patch) | |
tree | bb18db6f9ab2332e53886202760851fddc3f0d08 /fs/ceph | |
parent | 020c4bddc030815a767d86ba36ee0563e9855c23 (diff) |
ceph: fscache: Update object store limit after file writing
Synchronize object->store_limit[_l] with new inode->i_size after file writing.
Tested-by: Milosz Tanski <milosz@adfin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Min Chen <minchen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index c298a7b8a1ce..2862a75fb949 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -970,6 +970,7 @@ retry_snap: | |||
970 | goto retry_snap; | 970 | goto retry_snap; |
971 | } | 971 | } |
972 | } else { | 972 | } else { |
973 | loff_t old_size = inode->i_size; | ||
973 | /* | 974 | /* |
974 | * No need to acquire the i_truncate_mutex. Because | 975 | * No need to acquire the i_truncate_mutex. Because |
975 | * the MDS revokes Fwb caps before sending truncate | 976 | * the MDS revokes Fwb caps before sending truncate |
@@ -980,6 +981,8 @@ retry_snap: | |||
980 | written = generic_file_buffered_write(iocb, iov, nr_segs, | 981 | written = generic_file_buffered_write(iocb, iov, nr_segs, |
981 | pos, &iocb->ki_pos, | 982 | pos, &iocb->ki_pos, |
982 | count, 0); | 983 | count, 0); |
984 | if (inode->i_size > old_size) | ||
985 | ceph_fscache_update_objectsize(inode); | ||
983 | mutex_unlock(&inode->i_mutex); | 986 | mutex_unlock(&inode->i_mutex); |
984 | } | 987 | } |
985 | 988 | ||