mirror of
https://github.com/versity/scoutfs.git
synced 2026-08-27 19:36:52 +00:00
1398b2316d923915376b90f3f25a10066b67494a
The updating of the inode index items was racey. It loaded the inode values, updated the items, loaded the fields again, and then stored the fields in the inode info. All without locking. Concurrent attempts could get the fields scrambled and racing with other paths that update the fields could get the items and inode info out of sync. This fixes up the two races by only reading the inode fields once and performing the multi-stage update under a mutex. We add a new lock to avoid ordering problems with trying to add an existing lock at these points in the locking heirarchy. We specifically use a mutex because the item functions can block. Now the inode index field update just has to safely race with concurrent access to the fields. This was found by generic/037 once getattr started refreshing the inode. It now passes again. Signed-off-by: Zach Brown <zab@versity.com>
Description
No description provided
7.5 MiB
Languages
C
86.4%
Shell
9.9%
Roff
2.5%
TeX
0.8%
Makefile
0.4%