From: Yunchuan Wen Date: Thu, 26 Dec 2013 14:29:28 +0000 (-0800) Subject: ceph: fscache: Wait for completion of object initialization X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f1fc4fee3bb163eebd0e1d16a8c84b66af03886e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Yunchuan Wen Signed-off-by: Min Chen Signed-off-by: Li Wang --- 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, 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);