zsh-users
 help / color / mirror / code / Atom feed
* No fsync on history file? I lost my history
@ 2018-09-23  8:52 lilydjwg
  2018-09-23 13:35 ` Daniel Shahaf
  0 siblings, 1 reply; 10+ messages in thread
From: lilydjwg @ 2018-09-23  8:52 UTC (permalink / raw)
  To: zsh-users

(Resending to zsh-users because my message to zsh-workers seemed to be
ignored.)

Hi there!

I just experienced a kernel oops. When I was back after a hard reset,
I lost my entire zsh history: the file was truncated to zero bytes.

I noticed zsh writes to a temporary file first, then renames, but
doesn't call fsync after finishing writing. I talked with my friend
knowing a lot about filesystems and I think a fsync will prevent this
kind of thing (or it'll be a kernel bug).

What do you think? Would you add the fsync call or make an option for
that? I recovered from a backup but it was not great experience.

-- 
Best regards,
lilydjwg

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-09-24  3:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-23  8:52 No fsync on history file? I lost my history lilydjwg
2018-09-23 13:35 ` Daniel Shahaf
2018-09-23 14:22   ` lilydjwg
2018-09-23 14:46     ` Daniel Shahaf
2018-09-23 15:25       ` lilydjwg
2018-09-23 15:45         ` Daniel Shahaf
2018-09-23 19:40           ` Vincent Lefevre
2018-09-24  3:03             ` lilydjwg
2018-09-23 18:02         ` Mikael Magnusson
2018-09-24  3:04           ` lilydjwg

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).