mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-24 00:53:01 +00:00
e803b10bca1539aed13a1ab8a9cf540a5d120347
If scoutfs_unlock() sees that it isn't the last task using a lock it just returns. It doesn't unlock the lock and it doesn't drop the lock refcnt and users. This leaks the lock refcnt and users because find_alloc_scoutfs_lock() always increments them when it finds a lock. Inflated counts will stop the shrinker from freeing the locks and eventually the counts will wrap and could cause locks to be freed while they're still in use. We can either always drop the refcnt/users in unlock or we can drop them in lock as we notice that our task already has the lock. I chose to have the task ref hold one refcnt/users which are only dropped as the final task unlocks. Signed-off-by: Zach Brown <zab@versity.com>
Description
No description provided
6.8 MiB
Languages
C
86.3%
Shell
10%
Roff
2.5%
TeX
0.8%
Makefile
0.4%