Blocking truncate()
Blocking truncate()
Posted Mar 13, 2015 17:07 UTC (Fri) by cesarb (subscriber, #6266)Parent article: Progress on persistent memory
Having truncate() block potentially forever, without a special flag to the truncate() call, would still be surprising behavior. Say a sysadmin notices a "hung" process; how would he find that it was a truncate() waiting for a mmap(), and most important, how would he find which are the files involved and which process he should kill so the truncate() goes ahead?
It would be as annoying as "mandatory locking".
We already sort of have that problem with NFS, but with NFS it's easy to find (check the server for all mounted filesystems to see if any isn't responding) and solve (reboot the hung server).
Posted Mar 13, 2015 21:16 UTC (Fri)
by zlynx (guest, #2285)
[Link]
Then lsof would show that file handle 14 is /nvm/datafile.
fuser -v /nvm/datafile shows the programs using it.
I think that sequence of commands would do the trick.
Posted Mar 15, 2015 14:52 UTC (Sun)
by pflugstad (subscriber, #224)
[Link]
Posted Apr 9, 2015 18:53 UTC (Thu)
by Jandar (subscriber, #85683)
[Link]
What happens if a write enlarges the file to have a new backing for the mmapped region? If the truncate is blocked, would it revert this enlargement after unmap()?
Blocking the truncating process opens needlessly a can of worms.
Blocking truncate()
Blocking truncate()
Blocking truncate()