HomeFreeBSD

vn_start_write(): consistently set *mpp to NULL on error or after failed sleep

Description

vn_start_write(): consistently set *mpp to NULL on error or after failed sleep

This ensures that *mpp != NULL iff vn_finished_write() should be
called, regardless of the returned error, except for V_NOWAIT.
The only exception that must be maintained is the case where
vn_start_write(V_NOWAIT) is called with the intent of later dropping
other locks and then doing vn_start_write(V_XSLEEP), which needs the mp
value calculated from the non-waitable call above it.

Also note that V_XSLEEP is not supported by vn_start_secondary_write().

Reviewed by: markj, mjg (previous version), rmacklem (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39441

Details

Provenance
kibAuthored on Apr 5 2023, 9:00 PM
Reviewer
markj
Differential Revision
D39441: vn_start_write(): consistently set *mpp to NULL on error or after failed sleep
Parents
rGb2f32887475f: vn_start_write(): minor style
Branches
Unknown
Tags
Unknown