sanitize_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ sanitize_state(9) ✨

okay so bestie, welcome to the kernel API manual for sanitize_state πŸ’… this one lives in the DRBD corner of the kernel and honestly? it's giving "the cleanup crew of state transitions." no cap.


πŸŽ€ NAME πŸŽ€

sanitize_state β€” resolves implicitly necessary additional changes to a state transition πŸ’–

like, you thought you were just doing one little state change? girl no. this function handles the extra changes that come along for the ride.


🌸 SYNOPSIS 🌸

union drbd_state sanitize_state (struct drbd_device *device , union
drbd_state os , union drbd_state ns , enum sanitize_state_warnings *warn
);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • device β€” DRBD device. the main character of this whole operation 🫢
  • os β€” old state. the vibe before.
  • ns β€” new state. the vibe after.
  • warn β€” placeholder for returned state warning. yes, it's literally a spot for the function to hand you back a warning ⚠️

πŸ‘‘ DESCRIPTION πŸ‘‘

When we loose connection, we have to set the state of the peers disk (pdsk) to D_UNKNOWN. and that's just the start, bestie β€” this rule and many more along those lines are in this function.

so lowkey, sanitize_state is the one doing the "okay but if this happens then obviously we also gotta change that" thinking. iconic behavior tbh πŸ”₯


🌈 SEE ALSO 🌈


fr fr, go read those too if you wanna understand the whole state-transition friend group 😭 this one's just the member that fixes everyone's outfits before the photo.

and that's the whole page, bestie πŸŽ€ brought to you by ./drivers/block/drbd, dated October 2026 β€” luv u, stay valid βœ¨πŸ’œ

πŸ“¦ where this page comes from