Messages in this thread | | | Date | Sun, 6 Jun 2004 12:00:54 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: clone() <-> getpid() bug in 2.6? |
| |
On Sun, 6 Jun 2004, Simon Kirby wrote: > > Unrelated to this discussion -- and there is a close() missing -- but is > there any reason for fsync() to be there?
It only matters if the lock is meaningful over an involuntary reboot (aka crash). Usually it isn't. So yes, the fsync() is usually not necessary.
Sometimes the lock file may contain real data that is meaningful for recovery, though. The pid generally isn't, but it could point to a log that describes what the thing was about to do. Or it could just be helpful on next reboot when you have a stale lockfile, and you want to match that lockfile to any syslog messages or similar.
Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |