If the vnode is share-locked: - Use vn_delayed_setsize() to avoid calling vnode_pager_setsize() with the vnode only shared locked. - Interlock the vnode to get exclusive mode for updating the node fields. Reciprocally, interlock the vnode in p9fs_getattr_dotl() to observe the consistent values on read. PR: 293492 p9fs: use atomics for updating node->flags This should prevent seeing inconsistent flags values when updating it under the shared vnode lock.
Details
Details
- Reviewers
markj
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| sys/fs/p9fs/p9fs_vnops.c | ||
|---|---|---|
| 1004 | Surely this and the assignments above should be exclusively locked? Maybe add an XXX comment for it. | |
| sys/fs/p9fs/p9fs_vnops.c | ||
|---|---|---|
| 1004 | I used the vnode interlock there, instead of adding the XXX comment. | |
| sys/fs/p9fs/p9fs_vnops.c | ||
|---|---|---|
| 973 | I would not bother with the micro-optimization of avoiding the interlock. Oh, it's not an optimization, it's required to avoid a LOR with the VM object lock in vnode_pager_setsize(). I think a comment should explain this. | |