g_vfs_close_unlocked(9): wrapper around g_vfs_close(9) that locks both bo vnode and topology. filesystems: use g_vfs_close_unlocked(9) As result, we lock the devvp vnode around calls to VOP_FSYNC() on unmount. For instance, the vn_fsync_buf() implementation of fsync() needs exclusive lock on the vnode to guarantee that all dirty buffers are indeed synced. VFS: require locked vnode for fsync() Stop exempting devfs nodes. Tested by: pho
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Does bufbdflush() need to be updated? I am not sure if it is ever called with a devvp.
| sys/geom/geom_vfs.c | ||
|---|---|---|
| 343 | Since this variant is called most often, can we call it g_vfs_close() and instead export g_vfs_close_locked()? | |
| sys/ufs/ffs/ffs_vfsops.c | ||
| 1323 ↗ | (On Diff #187512) | Can't this callsite be converted too? |
Comment Actions
bdwrite() is called with the vnode locked, I believe.
| sys/geom/geom_vfs.c | ||
|---|---|---|
| 343 | I wanted to not change the VFS/GEOM interface arbitrarly, The first version of the patch was indeed changing the g_vfs_close() to g_vfs_close_locked(). I decided against because it was only the name change, so any out-of-tree filesystems become silently broken. | |
| sys/ufs/ffs/ffs_vfsops.c | ||
| 1323 ↗ | (On Diff #187512) | No, we need the devvp vnode locked for the mntfs_freevp() call below. |