From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cust-95-128-94-82.breedbanddelft.nl ([95.128.94.82]:51660 "EHLO cust-95-128-94-82.breedbanddelft.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbeIERQz (ORCPT ); Wed, 5 Sep 2018 13:16:55 -0400 Date: Wed, 5 Sep 2018 14:46:46 +0200 From: Rogier Wolff To: "Austin S. Hemmelgarn" Cc: =?utf-8?B?54Sm5pmT5Yas?= , martin@lichtvoll.de, jlayton@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: POSIX violation by writeback error Message-ID: <20180905124646.GR17123@BitWizard.nl> References: <20180905070847.GC24519@BitWizard.nl> <3805399.0d8HT3LL4o@merkaba> <20180905080444.GD24519@BitWizard.nl> <1b02ddae-35ae-8ff7-760f-bc9bafee4541@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1b02ddae-35ae-8ff7-760f-bc9bafee4541@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Sep 05, 2018 at 08:07:25AM -0400, Austin S. Hemmelgarn wrote: > On 2018-09-05 04:37, 焦晓冬 wrote: > >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. Again, the "returning an error guarantees it isn't" is what's important here. A lot of scenarios exist where it is a slightly less important file than "/bin/sh" that would trigger such a comiplete system failure. But there are a whole lot of files that can be pretty critical for a system where "old value" is better than "all programs get an error now". So when you propose "reads should now return error", you really need to think things through. It is not enough to say: But I encountered a situation where returning an error was preferable, you need to think through the counter-cases that others might run into that would make the "new" situation worse than before. Roger. -- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 ** ** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 ** *-- BitWizard writes Linux device drivers for any device you may have! --* The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.