Commit f1fc4fee authored by Yunchuan Wen's avatar Yunchuan Wen Committed by Yan, Zheng

ceph: fscache: Wait for completion of object initialization

The object store limit needs to be updated after writing,
and this can be done provided the corresponding object has already
been initialized. Current object initialization is done asynchrously,
which introduce a race if a file is opened, then immediately followed
by a writing, the initialization may have not completed, the code will
reach the ASSERT in fscache_submit_exclusive_op() to cause kernel
bug.
Tested-by: default avatarMilosz Tanski <milosz@adfin.com>
Signed-off-by: default avatarYunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: default avatarMin Chen <minchen@ubuntukylin.com>
Signed-off-by: default avatarLi Wang <liwang@ubuntukylin.com>
parent 32d3e148
......@@ -205,6 +205,7 @@ void ceph_fscache_register_inode_cookie(struct ceph_fs_client* fsc,
ci->fscache = fscache_acquire_cookie(fsc->fscache,
&ceph_fscache_inode_object_def,
ci, true);
fscache_check_consistency(ci->fscache);
done:
mutex_unlock(&inode->i_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment