fscache: Fix incorrect mixing of wake/wait and missing barriers
Hi Linus,
Could you pull these fixes from Hou Tao please? There are two problems fixed in fscache volume handling:
(1) wake_up_bit() is incorrectly paired with wait_var_event(). The latter selects the waitqueue to use differently.
(2) Missing barriers ordering between state bit and task state.
Thanks,
David
To quote Hou Tao:
The patchset includes two fixes for fscache volume operations: patch 1 fixes the hang problem during volume acquisition when the volume acquisition process waits for the freeing of relinquished volume, patch 2 adds the missing memory barrier in fscache_create_volume_work() and it is spotted through code review when checking whether or not these is missing smp_mb() before invoking wake_up_bit().
Change Log:
v3:
* Use clear_and_wake_up_bit() helper (Suggested by Jingbo Xu)
* Tidy up commit message and add Reviewed-by tag
v2: https://listman.redhat.com/archives/linux-cachefs/2022-December/007402.html
* rebased on v6.1-rc1
* Patch 1: use wait_on_bit() instead (Suggested by David)
* Patch 2: add the missing smp_mb() in fscache_create_volume_work()
v1: https://listman.redhat.com/archives/linux-cachefs/2022-December/007384.html
---
The following changes since commit 6d796c50f84ca79f1722bb131799e5a5710c4700:
Linux 6.2-rc6 (2023-01-29 13:59:43 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/fscache-fixes-20230130
for you to fetch changes up to 3288666c72568fe1cc7f5c5ae33dfd3ab18004c8:
fscache: Use clear_and_wake_up_bit() in fscache_create_volume_work() (2023-01-30 12:51:54 +0000)
----------------------------------------------------------------
fscache fixes
----------------------------------------------------------------
Hou Tao (2):
fscache: Use wait_on_bit() to wait for the freeing of relinquished volume
fscache: Use clear_and_wake_up_bit() in fscache_create_volume_work()
fs/fscache/volume.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
The pull request you sent on Mon, 30 Jan 2023 13:04:43 +0000:
The pull request you sent on Mon, 30 Jan 2023 13:04:43 +0000:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.gittags/fscache-fixes-20230130
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/22b8077d0fcec86c6ed0e0fce9f7e7e5a4c2d56a
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html