Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3467034imm; Wed, 5 Sep 2018 00:10:35 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYFYNO42Mc5Bn5p8Fn2u8n0Dv3mm3wa2KzqruXMBQ/GPoZS2hQweKPo60HQzx85OP5HPsJn X-Received: by 2002:a17:902:a507:: with SMTP id s7-v6mr36472396plq.303.1536131435143; Wed, 05 Sep 2018 00:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536131435; cv=none; d=google.com; s=arc-20160816; b=dB9FA7C/Z/9krBPD6paPgMW3opbHAo/H3OhqzPcjri3CpblyBxYcXF0vk5I4jzEkJ4 cn7pHpIROrGGxxtgGooZ42hkOlF0EUbUU6etxkEdE0S+UL8MgtwnVSk7/ltjMDEDxbuA psz8U6Aaqai9ySGL26l39bn7nqhijifhiQ6lEXGSBs6ZHFbc4L5NTNS2Ma9w2Agp+zW/ eP8jy54pFh4tYPgkIDPGVTRQDoDRbG0C6TqOYNET+q/CPNPvQ4M/cnZrIgNNMPmFS1qD SlCf5//g7U2fWM79aHKcyTBOHMDSTiJBgP4DNo3vQuz5G27oPU0xgjEELpD1MGY+RdAC FLuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=22+7yhfWePDYSm0DcbUYoq+BG1nUy9D5PgWdAvkZB0A=; b=f7pVAl3B/oMjrdVgF3adfm7Qj5y0qvGHt+taCdzBix6Bkh+ayepyUFGwHQZo13qMyO ykGKiDp/ogqr2VElfd22/o7dxL18nfDJoX2m+gDxbWyn0+Hlw9D4OA8Iwtr/H7UBto+b MkgxygjJxRV9qz99kOGoikDyvuVJVJ6BQcICWrOzF/zGObhzIuw7QDT1XPAAlzqg07h9 C9jGxmboa3Fde5CtOVkQcfLyPhzFYwWjqti6wQ5/fMN+oXjgYTFTHkFJ808MPKQJIzln 25QGrcR2gBgbsjMpC61rvsaEu2Uwp4Yc83/dE5COAN055uDETFUskvYfXjatRvL8nD9w kaAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2-v6si1151516pgl.140.2018.09.05.00.10.20; Wed, 05 Sep 2018 00:10:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727837AbeIELhe (ORCPT + 99 others); Wed, 5 Sep 2018 07:37:34 -0400 Received: from cust-95-128-94-82.breedbanddelft.nl ([95.128.94.82]:44548 "EHLO cust-95-128-94-82.breedbanddelft.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbeIELhe (ORCPT ); Wed, 5 Sep 2018 07:37:34 -0400 Received: by abra2.bitwizard.nl (Postfix, from userid 1000) id 36EF913F782; Wed, 5 Sep 2018 09:08:47 +0200 (CEST) Date: Wed, 5 Sep 2018 09:08:47 +0200 From: Rogier Wolff To: Jeff Layton Cc: =?utf-8?B?54Sm5pmT5Yas?= , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: POSIX violation by writeback error Message-ID: <20180905070847.GC24519@BitWizard.nl> References: <20180904075347.GH11854@BitWizard.nl> <82ffc434137c2ca47a8edefbe7007f5cbecd1cca.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: BitWizard B.V. User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 04, 2018 at 11:44:20AM -0400, Jeff Layton wrote: > On Tue, 2018-09-04 at 22:56 +0800, 焦晓冬 wrote: > > On Tue, Sep 4, 2018 at 7:09 PM Jeff Layton wrote: > > > > > > On Tue, 2018-09-04 at 16:58 +0800, Trol wrote: > > > > That is certainly not possible to be done. But at least, shall we report > > > > error on read()? Silently returning wrong data may cause further damage, > > > > such as removing wrong files since it was marked as garbage in the old file. > > > > > > > > > > Is the data wrong though? You tried to write and then that failed. > > > Eventually we want to be able to get at the data that's actually in the > > > file -- what is that point? > > > > The point is silently data corruption is dangerous. I would prefer getting an > > error back to receive wrong data. > > > > Well, _you_ might like that, but there are whole piles of applications > that may fall over completely in this situation. Legacy usage matters > here. Can I make a suggestion here? First imagine a spherical cow in a vacuum..... What I mean is: In the absence of boundary conditions (the real world) what would ideally happen? I'd say: * When you've written data to a file, you would want to read that written data back. Even in the presence of errors on the backing media. But already this is controversial: I've seen time-and-time again that people with raid-5 setups continue to work untill the second drive fails: They ignored the signals the system was giving: "Please replace a drive". 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 (*)) So maybe when the write fails, the reads on that file should fail? Then it means the data required to keep in memory is much reduced: you only have to keep the metadata. In both cases, semantics change when a reboot happens before the read. Should we care? If we can't fix it when a reboot has happened, does it make sense to do something different when a reboot has NOT happened? Roger. (*) I have 800Gb of data I need to give to a client. The truck-of-tapes solution of today is a 1Tb USB-3 drive. Writing that data onto the drive runs at 30Mb/sec (USB2 speed: USB3 didn't work for some reason) for 5-10 seconds and then slows down to 200k/sec for minutes at a time. One of the reasons might be that fuse-ntfs is calling fsync on the MFT and directory files to keep stuff consistent just in case things crash. Well... In this case this means that copying the data took 3 full days instead of 3 hours. Too much calling fsync is not good either. -- ** 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.