+2
−2
+2
−4
+2
−2
Loading
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT -------------------------------- Both fscache_object_lookup_negative() and fscache_obtained_object() call clear_bit_unlock() and then wake_up_bit(). Although there are memory barriers in clear_bit_unlock() to ensure that the memory order before it is normal, but not to guarantee the order after it. And wake_up_bit() has no memory order guarantee. This will probably trigger a problem. Execute wake_up_bit() first to wake up the waiting thread, but the cookie flag is not cleared. After that, the wait thread detects that the flag still exists and will continue to sleep to be awakened again. The wake thread then clears the bit, but there is no wake operation, leaving mount waiting to be woken that blocking other process. Fix this issue by using clear_and_wake_up_bit() to adding a memory barrier between clearing the flag and waking. In addition, we also need to ensure the memory order of the wait side, so use wait_on_bit_acquire(). Fixes: caaef690 ("FS-Cache: Fix object state machine to have separate work and wait states") Signed-off-by:Zizhi Wo <wozizhi@huawei.com> Signed-off-by:
Baokun Li <libaokun1@huawei.com>