linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: 焦晓冬 <milestonejxd@gmail.com>, R.E.Wolff@bitwizard.nl
Cc: martin@lichtvoll.de, jlayton@redhat.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: POSIX violation by writeback error
Date: Wed, 5 Sep 2018 08:07:25 -0400	[thread overview]
Message-ID: <1b02ddae-35ae-8ff7-760f-bc9bafee4541@gmail.com> (raw)
In-Reply-To: <CAJDTihya-DxyjzPJfh0LX+qOs2jvwr5TakcmRr8_U7h3pdw6cg@mail.gmail.com>

On 2018-09-05 04:37, 焦晓冬 wrote:
> On Wed, Sep 5, 2018 at 4:04 PM Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote:
>>
>> On Wed, Sep 05, 2018 at 09:39:58AM +0200, Martin Steigerwald wrote:
>>> Rogier Wolff - 05.09.18, 09:08:
>>>> So when a mail queuer puts mail the mailq files and the mail processor
>>>> can get them out of there intact, nobody is going to notice.  (I know
>>>> mail queuers should call fsync and report errors when that fails, but
>>>> there are bound to be applications where calling fsync is not
>>>> appropriate (*))
>>>
>>> AFAIK at least Postfix MDA only reports mail as being accepted over SMTP
>>> once fsync() on the mail file completed successfully. And I´d expect
>>> every sensible MDA to do this. I don´t know how Dovecot MDA which I
>>> currently use for sieve support does this tough.
>>
> 
> Is every implementation of mail editor really going to call fsync()? Why
> they are going to call fsync(), when fsync() is meant to persist the file
> on disk which is apparently unnecessary if the delivering to SMTP task
> won't start again after reboot?
Not mail clients, the actual servers.  If they implement the SMTP 
standard correctly, they _have_ to call fsync() before they return that 
an email was accepted for delivery or relaying, because SMTP requires 
that a successful return means that the system can actually attempt 
delivery, which is not guaranteed if they haven't verified that it's 
actually written out to persistent storage.
> 
>> Yes. That's why I added the remark that mailers will call fsync and know
>> about it on the write side. I encountered a situation in the last few
>> days that when a developer runs into this while developing, would have
>> caused him to write:
>>    /* Calling this fsync causes unacceptable performance */
>>    // fsync (fd);
>>
>> I know of an application somewhere that does realtime-gathering of
>> call-records (number X called Y for Z seconds). They come in from a
>> variety of sources, get de-duplicated standardized and written to
>> files. Then different output modules push the data to the different
>> consumers within the company. Billing among them.
>>
>> Now getting old data there would be pretty bad. And calling fsync
>> all the time might have performance issues....
>>
>> That's the situation where "old data is really bad".
>>
>> But when apt-get upgrade replaces your /bin/sh and gets a write error
>> returning error on subsequent reads is really bad.
> 
> At this point, the /bin/sh may be partially old and partially new. Execute
> this corrupted bin is also dangerous though.
But the system may still be usable in that state, while returning an 
error there guarantees it isn't.  This is, in general, not the best 
example though, because no sane package manager directly overwrites 
_anything_, they all do some variation on replace-by-rename and call 
fsync _before_ renaming, so this situation is not realistically going to 
happen on any real system.

  reply	other threads:[~2018-09-05 16:37 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04  6:32 POSIX violation by writeback error 焦晓冬
2018-09-04  7:53 ` Rogier Wolff
2018-09-04  8:58   ` 焦晓冬
2018-09-04  9:29     ` Rogier Wolff
2018-09-04 10:45       ` 焦晓冬
2018-09-04 11:09     ` Jeff Layton
2018-09-04 14:56       ` 焦晓冬
2018-09-04 15:44         ` Jeff Layton
2018-09-04 16:12           ` J. Bruce Fields
2018-09-04 16:23             ` Rogier Wolff
2018-09-04 18:54               ` J. Bruce Fields
2018-09-04 20:18                 ` Jeff Layton
2018-09-04 20:35                   ` Vito Caputo
2018-09-04 21:02                     ` Matthew Wilcox
2018-09-05  0:51                     ` Dave Chinner
2018-09-05  8:24                   ` 焦晓冬
2018-09-05 10:55                     ` Jeff Layton
2018-09-05 12:07                       ` Rogier Wolff
2018-09-06  2:57                         ` Dave Chinner
2018-09-06  9:17                           ` Rogier Wolff
2018-09-24 23:09                             ` Alan Cox
2018-09-05 13:53                       ` J. Bruce Fields
2018-09-05  7:08           ` Rogier Wolff
2018-09-05  7:39             ` Martin Steigerwald
2018-09-05  8:04               ` Rogier Wolff
2018-09-05  8:37                 ` 焦晓冬
2018-09-05 12:07                   ` Austin S. Hemmelgarn [this message]
2018-09-05 12:46                     ` Rogier Wolff
2018-09-05  9:32                 ` Martin Steigerwald
2018-09-05  7:37           ` Martin Steigerwald
2018-09-05 11:42             ` Jeff Layton
2018-09-05  8:09           ` 焦晓冬
2018-09-05 13:08             ` Theodore Y. Ts'o
2018-09-24 23:21               ` Alan Cox
2018-09-06  7:28             ` 焦晓冬
     [not found] <CAJDTihx2yaR-_-9Ks1PoFcrKNZgUOoLdN-wRTTMV76Jg_dCLrw@mail.gmail.com>
2018-09-04 10:56 ` Jeff Layton
2018-09-24 23:30   ` Alan Cox
2018-09-25 11:15     ` Jeff Layton
2018-09-25 15:46       ` Theodore Y. Ts'o
2018-09-25 16:17         ` Rogier Wolff
2018-09-25 16:39         ` Alan Cox
2018-09-25 16:41         ` Jeff Layton
2018-09-25 22:30           ` Theodore Y. Ts'o
2018-09-26 18:10             ` Alan Cox
2018-09-26 21:49               ` Theodore Y. Ts'o
2018-09-27 22:48                 ` Alan Cox
2018-09-27  7:18               ` Rogier Wolff
2018-09-27 12:43             ` Jeff Layton
2018-09-27 14:27               ` Theodore Y. Ts'o
2018-09-25 17:35         ` Adam Borowski
2018-09-25 22:46           ` Theodore Y. Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b02ddae-35ae-8ff7-760f-bc9bafee4541@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=R.E.Wolff@bitwizard.nl \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@lichtvoll.de \
    --cc=milestonejxd@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).