sanitize_state(9)
β¨ 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 π
- Kernel file
./drivers/block/drbd/drbd_state.c cl_wide_st_chg(9)drbd_force_state(9)drbd_req_state(9)_drbd_request_state(9)is_valid_state(9)is_valid_soft_transition(9)is_valid_transition(9)_drbd_set_state(9)after_state_ch(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms