From 32d3e148ddac0087fdd8499ce4075db20518e122 Mon Sep 17 00:00:00 2001 From: Yunchuan Wen Date: Thu, 26 Dec 2013 06:29:27 -0800 Subject: [PATCH] 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 Signed-off-by: Yunchuan Wen Signed-off-by: Min Chen Signed-off-by: Li Wang --- fs/ceph/file.c | 3 +++ 1 file changed, 3 insertions(+) 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 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov, goto retry_snap; } } else { + loff_t old_size = inode->i_size; /* * No need to acquire the i_truncate_mutex. Because * the MDS revokes Fwb caps before sending truncate @@ -980,6 +981,8 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov, written = generic_file_buffered_write(iocb, iov, nr_segs, pos, &iocb->ki_pos, count, 0); + if (inode->i_size > old_size) + ceph_fscache_update_objectsize(inode); mutex_unlock(&inode->i_mutex); } -- GitLab