Add locking around accesses to bv_cnt which are currently being done unlocked.
Details
Details
- Reviewers
imp - Group Reviewers
Contributor Reviewers (ports) - Commits
- rS294200: [PR 206224] bv_cnt is sometimes examined without holding the bufobj lock
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
I do not want to read nandfs code to see of there is any more issues than just bv_cnt.
sys/fs/nfsclient/nfs_clvfsops.c | ||
---|---|---|
1655 | I do not see what this change changes. The access is single read, which is atomic on itself. Assuming that bv_cnt is protected by bufobj lock, the test might become invalid immediately after the lock is dropped. I.e. the original and patched versions have equiv races and guarantees, except that the patched version adds locking overhead. | |
sys/kern/vfs_default.c | ||
1214 | Same comment there. |
Comment Actions
kib pointed out that the changes to nfs_clvfsops.c and vfs_default.c are unnecessary; revert them.
Comment Actions
There's other, much more heinous locking issues with nandfs. However, that doesn't make this any less legit. Go for it.