From: Zizhi Wo wozizhi@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT
----------------------------------------
If the meta object->flags is not set FSCACHE_OBJECT_IS_LOOKED_UP when __fscache_read_or_alloc_page() is executed, the ASSERT will fail and occur kernel BUG().
Under normal circumstances, fscache_wait_for_deferred_lookup() will wait the cookie lookup flag to be cleared, which at the same time set object lookup flag. But when object state LOOK_UP_OBJECT fail, it will enter LOOKUP_FAILURE state, execute fscache_lookup_failure() and clear the cookie lookup flags but not set object lookup flag, then the ASSERT fails and cause kernel BUG().
We do not need to trigger kernel BUG() directly, just clear the ASSERT as fscache_submit_op() will also check the object state later and intercept the error status.
Signed-off-by: Zizhi Wo wozizhi@huawei.com Signed-off-by: Baokun Li libaokun1@huawei.com --- fs/fscache/page.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/fs/fscache/page.c b/fs/fscache/page.c index 39a05a43284d..b08568743370 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c @@ -472,8 +472,6 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie, object = hlist_entry(cookie->backing_objects.first, struct fscache_object, cookie_link);
- ASSERT(test_bit(FSCACHE_OBJECT_IS_LOOKED_UP, &object->flags)); - __fscache_use_cookie(cookie); atomic_inc(&object->n_reads); __set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags);