diff options
author | Yunchuan Wen <yunchuanwen@ubuntukylin.com> | 2013-12-26 09:29:28 -0500 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2014-04-02 22:33:53 -0400 |
commit | f1fc4fee3bb163eebd0e1d16a8c84b66af03886e (patch) | |
tree | eccd9e8d0da4c389d603408cf5a4360a62053635 /fs | |
parent | 32d3e148ddac0087fdd8499ce4075db20518e122 (diff) |
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: 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')
-rw-r--r-- | fs/ceph/cache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index 8c44fdd4e1c3..834f9f3723fb 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c | |||
@@ -205,6 +205,7 @@ void ceph_fscache_register_inode_cookie(struct ceph_fs_client* fsc, | |||
205 | ci->fscache = fscache_acquire_cookie(fsc->fscache, | 205 | ci->fscache = fscache_acquire_cookie(fsc->fscache, |
206 | &ceph_fscache_inode_object_def, | 206 | &ceph_fscache_inode_object_def, |
207 | ci, true); | 207 | ci, true); |
208 | fscache_check_consistency(ci->fscache); | ||
208 | done: | 209 | done: |
209 | mutex_unlock(&inode->i_mutex); | 210 | mutex_unlock(&inode->i_mutex); |
210 | 211 | ||