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)
Oct 1 2024, 1:51 PM
Unknown Object (File)
Sep 27 2024, 2:13 AM
Unknown Object (File)
Sep 25 2024, 2:37 AM
Unknown Object (File)
Sep 23 2024, 9:59 AM
Unknown Object (File)
Sep 20 2024, 11:01 PM
Unknown Object (File)
Sep 20 2024, 9:28 PM
Unknown Object (File)
Sep 16 2024, 12:51 AM
Unknown Object (File)
Sep 8 2024, 12:33 PM
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