__break_lease(9)
π __break_lease β Kernel API Manual, bestie edition
okay so real talk, we're in __break_lease(9) today and this one is giving chaos gremlin energy because it's literally the function that says "girl, your lease is UP." it lives in the kernel API manual and honestly it ate.
β¨ NAME β¨
__break_lease β revoke all outstanding leases on file
like... ALL of them. every last one. no survivors. π
π SYNOPSIS π
int __break_lease (struct inode *inode , unsigned int flags );
she takes two things and returns an int, periodt.
π¦ ARGUMENTS π¦
inodeβ the inode of the file to return πΈ (yes bestie, this is the file we're revoking leases on, she's the main character here)flagsβLEASE_BREAK_*flags π― (the lil modifiers that tell her how to behave, iykyk)
π DESCRIPTION π
okay so here's the lore: break_lease (which is inlined for speed, miss thing does NOT have time to be a real function call) has already checked that there is at least some kind of lock on this file β maybe a lease, maybe not, she's not picky. that check already happened. not her problem anymore. β¨
so when do leases and delegations get broken? bestie, gather round:
- Leases and Delegations are broken on a call to
openortruncateπ₯ - Delegations are also broken on any event that would change the
ctimeπ (time stuff changes? delegation says bye) - Directory delegations are broken whenever the directory changes π β unless the delegation is set up to ignore the event, in which case she's like "not me, not today" π
and here's the important bit, so pay attention: this function can block waiting for the lease break. like, actually block. sitting there. waiting. π
unless you specify LEASE_BREAK_NONBLOCK, in which case she does NOT wait and you get to find out what happens immediately. your call, bestie. choose wisely. π
π SEE ALSO π
she runs with a whole squad over in the Kernel file ./fs/locks.c, and here's the full group chat:
locks_owner_has_blockers(9)lease_open_conflict(9)locks_delete_block(9)posix_lock_file(9)posix_lock_inode_wait(9)inode_lease_ignore_mask(9)lease_get_mtime(9)__fcntl_getlease(9)generic_setlease(9)vfs_setlease(9)fcntl_setlease(9)fcntl_setdeleg(9)flock_lock_inode_wait(9)locks_lock_inode_wait(9)sys_flock(9)vfs_test_lock(9)locks_translate_pid(9)vfs_lock_file(9)vfs_cancel_lock(9)vfs_inode_has_locks(9)
like, that's the whole friend group. go read them too, fr fr. π«Ά
and that's the page!! source/version is ./fs, dated October 2026, and the page itself is __break_lease(9) β stan her, she's iconic. βπβ¨
π¦ 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