This is dumb. I admit it.
But I was deep into something and kept typing "sync sync sync" and getting annoyed when it only called sync(2) once.
If this is too stupid to allow, I accept that.
Differential D21660
Ask sync(8) to sync multiple times sef on Sep 14 2019, 8:17 PM. Authored by Tags None Referenced Files
Details
This is dumb. I admit it. But I was deep into something and kept typing "sync sync sync" and getting annoyed when it only called sync(2) once. If this is too stupid to allow, I accept that. [ truss -o /dev/stdout sync 5 | grep ^sync | wc -l -eq 5 ] && echo good
Diff Detail
Event TimelineComment Actions I think that a need for sync ; sync ; sync is greatly exaggerated. Comment Actions
Because I was making changes that happened in zfs on sync 8-). I was using multiple syncs to ensure everything did get synced out, and then examining status and structures. (And depending on timing, not everything did get synced out on the first one.) I _said_ it's a dumb change. It doesn't break anything, although it could introduce some delays if people had scripts that called sync and had arguments (using it as a dummy command, for some reason, maybe?). It may be useful. Or not :). Comment Actions If you need more than one sync, then you've broken posix semantics. sync ; sync ; sync hasn't been needed since the bug in the dk driver was fixed in V6! :) Comment Actions
Like that never happens. :) Comment Actions Could you please tell more about this? Comment Actions
As I said, it appeared to be timing-related. Specifically, there were some actions that weren't performed on the first sync, but were on the second. Not all the time, but enough so that I got into the habit of "test_command; sync; sync; sync" and forgot the semicolon occasionally. Comment Actions BTW, you marked it as needing revision, but didn't say what revision. Again: if this is too stupid, then I'm ok with killing it. Comment Actions So, maybe you'd better debug and fix that problem. As you said, this is dumb. And I agree :-) Comment Actions My understanding of the "old wives tale" was not sync()ing three times, but actually *typing* sync<enter> three times; by the time you finished typing the third one, any background operations initiated by the first one would have completed. Comment Actions More discussion about it than it's worth. Ah well. Seriously, thank you for the discussion. It was nice and light-hearted. Comment Actions Correction: not if you want, but if you know how many you need. |