Page MenuHomeFreeBSD

Useful changes taken from D33921
ClosedPublic

Authored by kib on Jan 28 2022, 3:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 5:07 AM
Unknown Object (File)
Dec 28 2023, 1:28 PM
Unknown Object (File)
Dec 10 2023, 9:44 PM
Unknown Object (File)
Nov 10 2023, 7:11 PM
Unknown Object (File)
Nov 8 2023, 3:33 AM
Unknown Object (File)
Nov 5 2023, 9:35 AM
Unknown Object (File)
Nov 5 2023, 8:35 AM
Unknown Object (File)
Nov 5 2023, 7:43 AM
Subscribers

Details

Summary
ufs: be more persistent with finishing some operations

when the vnode is doomed after relock.  The mere fact that the vnode is
doomed does not prevent us from doing UFS operations on it while it is
still belongs to UFS, which is determined by non-NULL v_data.  Not
finishing some operations, e.g. not syncing the inode block only because
the vnode started reclamation, is not correct.

Add macro IS_UFS() which incapsulates the v_data != NULL, and use it
instead of VN_IS_DOOMED() for places where the operation completion is
important.
ffs_snapblkfree(): add a comment explaining lockmgr invocation
ufs: Use IS_SNAPSHOT()
syncer VOP_FSYNC(): unlock syncer vnode around call to VFS_SYNC()

The lock is unneccessary since the mount point is busied, which prevents
unmount and syncer vnode deallocation.  Having the vnode locked causes
innocent LoRs and complicates debugging.

Also stop starting write accounting around it.  Any caller of
VOP_FSYNC() must do it already, and sync_vnode() does.
buf_alloc(): lock the buffer with LK_NOWAIT

The buffer must not be accessed by any other thread, it is freshly
allocated.  As such, LK_NOWAIT should be nop but also it prevents
recording the order between the buffer lock and any other locks we might
own in the call to getnewbuf().  In particular, if we own FFS snap lock,
it should avoid triggering false positive warning.
Use dedicated lock name for pbufs

Also remove a pointer to array variable, use address address directly.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Jan 28 2022, 3:07 AM

Based on our previous discussions in D33921 these changes improve readability and consistency.

This revision is now accepted and ready to land.Jan 28 2022, 7:13 AM