nfsd_filp_close(9)
π nfsd_filp_close(9) β Kernel API Manual π
okay bestie, we're in the nfsd_filp_close(9) page and it's giving "close this file, but synchronously" energy. Let's go. π«Ά
πΈ NAME πΈ
nfsd_filp_close β close a file synchronously. periodt. β¨
π¦ SYNOPSIS π¦
void nfsd_filp_close (struct file *fp );
π ARGUMENTS π
fpβ the file to close. that's the whole argument, no cap π
π DESCRIPTION π
okay so nfsd_filp_close is similar in behaviour to filp_close. the iconic difference? if this is the final close on the file, that finalisation happens immediately instead of being handed over to a work_queue, which is what happens with filp_close. The way that's a whole vibe. π
When a user-space process closes a file β even when it's using filp_close β the finalisation happens before returning to userspace, so it's effectively synchronous. But when a kernel thread uses file_close, on the other hand, the handling is completely asynchronous. π
That means any cost imposed by that finalisation is not imposed on the nfsd thread, and nfsd could potentially close files more quickly than the work queue finalises the close. and that would lead to unbounded growth in the queue. not slay. π
In some contexts it is not safe to synchronously wait for close finalisation (see the comment for __fput_sync), but nfsd does not match those contexts. In particular, it does not, at the time that this function is called, hold any locks, and no finalisation of any file, socket, or device driver would have any cause to wait for nfsd to make progress. no cap, that's the safety context. π§
π₯ SEE ALSO π₯
- Kernel file:
./fs/nfsd/vfs.c nfserrno(9)nfsd_lookup(9)nfsd_setattr(9)nfsd4_is_junction(9)nfsd_open_verified(9)nfsd_splice_read(9)nfsd_iter_read(9)nfsd_vfs_write(9)nfsd_read_splice_ok(9)nfsd_read(9)nfsd_write(9)nfsd_commit(9)nfsd_create_setattr(9)nfsd_symlink(9)nfsd_link(9)nfsd_rename(9)nfsd_unlink(9)nfsd_readdir(9)nfsd_removexattr(9)nfsd_get_case_info(9)
source/version: ./fs/nfsd Β· date: October 2026 Β· page: nfsd_filp_close(9) β mwah, go close that file synchronously bestie π
π¦ 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