mnt_hold_writers(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Bestie, welcome to mnt_hold_writers(9) from the Kernel API Manual β€” the page that says β€œhey, hold up” to write access on a mount πŸ’…βœ¨

🌸 NAME 🌸

mnt_hold_writers β€” prevent write access to the given mount.

✨ SYNOPSIS ✨

int mnt_hold_writers (struct mount *mnt );

πŸŽ€ ARGUMENTS πŸŽ€

  • mnt β€” the mnt you want to prevent write access to, bestie. That's the whole argument.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: this function prevents write access to mnt if there are no active writers for mnt. It has to be called and return successfully before you go changing properties of mnt that need to remain stable for callers with write access to mnt. No skipping steps, okay? 😌

After this function has been called successfully, callers must pair it with a call to mnt_unhold_writers to stop preventing write access to mnt. It's giving lock/unlock energy, but with mount writers. πŸ”’βœ¨

🧚 CONTEXT 🧚

This function expects to be in mount_locked_reader scope, serializing setting WRITE_HOLD. That's the vibe it needs. Periodt.

πŸ’« RETURN πŸ’«

On success, 0 is returned. On error, -EBUSY is returned. That's it, that's the whole return moment.

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./fs/namespace.c, plus all these iconic besties:


Signed, sealed, and sourced from ./fs πŸ’– dated October 2026 and forever known as mnt_hold_writers(9) 🫢

πŸ“¦ where this page comes from