From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23670-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 92e88777 for ; Sun, 23 Sep 2018 08:53:46 +0000 (UTC) Received: (qmail 15759 invoked by alias); 23 Sep 2018 08:53:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23670 Received: (qmail 14386 invoked by uid 1010); 23 Sep 2018 08:53:28 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf1-f169.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.210.169):SA:0(-1.9/5.0):. Processed in 2.33257 secs); 23 Sep 2018 08:53:28 -0000 X-Envelope-From: lilydjwg@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=Ut0qr0Dhar9pGk4Tflv3PgrAYdNftP7xfvO2a9G/N38=; b=iLVihaTVOyYrVpPYI0QBSEREqHn6usGZ6be7EyN2wbxXeSFqRnagKoP9LdvaSICGlv zvZO0bFJ4lW+QR2RzHhAgfQB2YnnrDy7dhpdXfOVh5nRQggdbSoKpr3mUOAWyh9nBYc2 PcsDwx5T60Dcy5COxQasz5x08fVYNJkmbin5OtmN7n36SRUVRPD0D51NDyKoW9KlFCw6 UV2wskoALsKn/kssjypXo/AUoK87OKVAtSlBchJKIzc1NOy7Tdzs46Gx3fKGywxwOBwR NnmV+Ez/JU5iWjGbfV7jObPDTt+4IuPDmTXwwQosBItY4CS1/S01ms2wJEA8TBht/BVm L0GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=Ut0qr0Dhar9pGk4Tflv3PgrAYdNftP7xfvO2a9G/N38=; b=LpXHFtab2iA0Ya4jVWCMb9GoH8cF0RCph+9F+4dcgRCrSX81sZZ90gACPzbTpEWDfb 6nFjMU/RPgootWZrYVeSXPafox2ndJIY04Lo5GhSSeQH+xshjxqaO/cfpebGScfVBFZo N2VclzqG0RjlUrahIbjlrg57c5MY0NnziojHM9Nyx1uSfGxRBCMQyqygm9uEUO0SGeH4 PrcS5pL3K4LRSlph9zcYOpCQCck1zcJQqIHjLY8/hut+68v9R6eqEvllAeIBbFgS6he8 XTmbdaGV1UR/2i20vqiEw7E2sL2QqoCgUjPdN3FHOT+2lo+U9ey225ltq61+o75yOGau 3YSQ== X-Gm-Message-State: APzg51B/mfhuCmPnQBxTJP2CsPiDFUnJAoWBa2j35CDXR1zYveyqG9V3 dWD+7niwhWDtVk8nhV969K/mdP6aT5o= X-Google-Smtp-Source: ANB0VdaeBkwksyss4EgzAogvHoM316ucfT/qnk/bmNsy4pO92GTzkqavx52E/QS5+mLMPctT7Tfw+g== X-Received: by 2002:a62:808c:: with SMTP id j134-v6mr5579720pfd.120.1537692801898; Sun, 23 Sep 2018 01:53:21 -0700 (PDT) Date: Sun, 23 Sep 2018 16:52:46 +0800 From: lilydjwg To: zsh-users@zsh.org Subject: No fsync on history file? I lost my history Message-ID: <20180923085246.GA19251@lilyforest.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) (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