提交 32d3e148 编写于 作者: Y Yunchuan Wen 提交者: Yan, Zheng

ceph: fscache: Update object store limit after file writing

Synchronize object->store_limit[_l] with new inode->i_size after file writing.
Tested-by: NMilosz Tanski <milosz@adfin.com>
Signed-off-by: NYunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: NMin Chen <minchen@ubuntukylin.com>
Signed-off-by: NLi Wang <liwang@ubuntukylin.com>
上级 020c4bdd
...@@ -970,6 +970,7 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -970,6 +970,7 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
goto retry_snap; goto retry_snap;
} }
} else { } else {
loff_t old_size = inode->i_size;
/* /*
* No need to acquire the i_truncate_mutex. Because * No need to acquire the i_truncate_mutex. Because
* the MDS revokes Fwb caps before sending truncate * 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, ...@@ -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, written = generic_file_buffered_write(iocb, iov, nr_segs,
pos, &iocb->ki_pos, pos, &iocb->ki_pos,
count, 0); count, 0);
if (inode->i_size > old_size)
ceph_fscache_update_objectsize(inode);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册