Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp49407lfv; Tue, 12 Apr 2022 16:50:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1dRvgP0ySfuCXpLrpp6e+kpcLWoku0MgcrFQbYamMzaRePoraBgF+Guu4Nbthr9X2T5lj X-Received: by 2002:a17:902:f789:b0:14e:ebbc:264b with SMTP id q9-20020a170902f78900b0014eebbc264bmr39275360pln.169.1649807432877; Tue, 12 Apr 2022 16:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649807432; cv=none; d=google.com; s=arc-20160816; b=gPGRHz9SHKMoZM8aplIFKjpHS+KZ6BPq7RzwIiBJ0fOGaQ83PWVYHShAtofwrs0pqS 7cyTn34piAzdIhW5uEq5ceYQ/Ia3/lLgOMqoNuVDzygriZ/if1fO5+hFrSGTI5jfOPEa HSXDAmtppq2e5pLXFOmh2xweRHR8nOnSiZtKlA+y4+LRF2aqJXjcJVZpvhiBp4QFtsjY euzHjvjB67ELsudBUrzx4gp3L+T78MrIp1VCpvaL5RCKr/E6s6+ipaVfSHs6bwn7rTYy niYDKREjIcMrXF5GMy38CLeoTePsxPuT1qPtNacQKNc17cYdbLZnhSwedk9TiTbwKIAs wqyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=6t6+UxwM0RDS7PSmMql+mRnWqOxOKFcLfaFyp4MZHPU=; b=J8xOEsanFooG5qPN3ivkcQNKpz//gthh6FPxINgRnjpyBaN37nUplbN8O4jPTOwZVJ VRcg96+BjEsY/IeqJ3PmWk/PoRID3i6046bJYNBC+qtgv121XnMZLMxslE+P+1TDNOwR GjEX2HM494YjvJaJtw+9gTcI0s9/O7LIahcvYuNIXhL34F4eQHg/Q5qWCn1Z6BXfAQ8q 86ymkyhBJg7rzvMtQdp6Zm0GsoiQgvi0U0AHiETRt5qopuBdpGwsSHI0Y/2rzlQZU7SV CnyX32RMaSGMa0MKWwHSRDpFQJutUBS6sElRnJJtyWVnTLdvXBjbmSHpHxocsroJV8+3 ITGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y37-20020a634965000000b0039a14e00b48si3722274pgk.567.2022.04.12.16.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:50:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9A871138580; Tue, 12 Apr 2022 14:43:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356431AbiDLOPU (ORCPT + 99 others); Tue, 12 Apr 2022 10:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233416AbiDLOPT (ORCPT ); Tue, 12 Apr 2022 10:15:19 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C7971D0C1; Tue, 12 Apr 2022 07:13:01 -0700 (PDT) Received: from kwepemi500018.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Kd71T5tNPzgYbW; Tue, 12 Apr 2022 22:11:09 +0800 (CST) Received: from kwepemm600015.china.huawei.com (7.193.23.52) by kwepemi500018.china.huawei.com (7.221.188.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 12 Apr 2022 22:12:58 +0800 Received: from [10.174.176.52] (10.174.176.52) by kwepemm600015.china.huawei.com (7.193.23.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 12 Apr 2022 22:12:58 +0800 Message-ID: Date: Tue, 12 Apr 2022 22:12:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH -next 1/2] nfs: nfs{,4}_file_flush should consume writeback error To: Trond Myklebust , "anna@kernel.org" , "smayhew@redhat.com" CC: "linux-nfs@vger.kernel.org" , "liuyongqiang13@huawei.com" , "linux-kernel@vger.kernel.org" , "yi.zhang@huawei.com" , "zhangxiaoxu5@huawei.com" References: <20220305124636.2002383-1-chenxiaosong2@huawei.com> <20220305124636.2002383-2-chenxiaosong2@huawei.com> <5666cb64-c9e4-0549-6ddb-cfc877c9c071@huawei.com> <037054f5ac2cd13e59db14b12f4ab430f1ddef5d.camel@hammerspace.com> <4a8e21fb-d8bf-5428-67e5-41c47529e641@huawei.com> <0528423f710cd612262666b1533763943c717273.camel@hammerspace.com> From: "chenxiaosong (A)" In-Reply-To: <0528423f710cd612262666b1533763943c717273.camel@hammerspace.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.52] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600015.china.huawei.com (7.193.23.52) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/4/12 21:56, Trond Myklebust 写道: > On Tue, 2022-04-12 at 21:46 +0800, chenxiaosong (A) wrote: >> >> Other filesystem will _not_ clear writeback error on close(). >> And other filesystem will _not_ clear writeback error on async >> write() too. >> >> Other filesystem _only_ clear writeback error on fsync() or sync >> write(). >> > > Yes. We might even consider not reporting writeback errors at all in > close(), since most developers don't check it. We certainly don't want > to clear those errors there because the manpages don't document that as > being the case. > >> Should NFS follow the same semantics as all the other filesystems? > > It needs to follow the semantics described in the manpage for write(2) > and fsync(2) as closely as possible, yes. That documentation is > supposed to be normative for application developers. > > We won't guarantee to immediately report ENOSPC like other filesystems > do (because that would require us to only support synchronous writes), > however that behaviour is already documented in the manpage. > > We may also report some errors that are not documented in the manpage > (e.g. EACCES or EROFS) simply because those errors cannot always be > reported at open() time, as would be the case for a local filesystem. > That's just how the NFS protocol works (particularly for the case of > the stateless NFSv3 protocol). > After merging your patchset, NFS will clear wb error on async write(), is this reasonable? And more importantly, we can not detect new error by using filemap_sample_wb_err()/filemap_sample_wb_err() while nfs_wb_all(),just as I described: ```c since = filemap_sample_wb_err() = 0 errseq_sample if (!(old & ERRSEQ_SEEN)) // nobody see the error return 0; nfs_wb_all // no new error error = filemap_check_wb_err(..., since) != 0 // unexpected error ```