Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp763339pxb; Tue, 12 Apr 2022 12:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjPuMEO/ncpHVOPZvhMc9PVDoAljOnEABeJvUYKeClmqN0G3G3tKVhdNepqAdNl27thW0F X-Received: by 2002:a65:6458:0:b0:39d:a9a7:723e with SMTP id s24-20020a656458000000b0039da9a7723emr1644548pgv.484.1649792946282; Tue, 12 Apr 2022 12:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649792946; cv=none; d=google.com; s=arc-20160816; b=FV66dUL1Bmzk34TJZZ+aeLMZXzzQhb43vvFhll3Nm+UCzKSn1AIphQ4CS0b0y/BXTw WVqhmJgF9BwgywHwxzNtsDS492Tf+Q9t+1t1MUgRFp+d+bSJ/PSqSoiRjgKrvDLeVee2 HQGvQJDZrSGhgCs5xeKZ8ro4CuhpgPbss35FZ8EnRGJOFrEIolSq4teGRHJQMqv8s1qt cTbSslWbz++e52bNAl2Bc8ldq0emxl/hsou5j8XkqUHmzO0MBQ66FGk1+4MCh6NENkFW GPLVPeLfGCAziNbXpDQLNSIExNC5UsrmRJxBaTx47qNOrZ5SOr3nzGIme0X2xafmQspT bQmg== 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:references :cc:to:from:subject:user-agent:mime-version:date:message-id; bh=KiQJ3bmca1kADxzSE2pvHS9i6MDqyzgw6nYPqofu1Pc=; b=ZPuCWV7qwts4iijrAOMcQ+N//ykPjbejqFmOriz9SGJ1QkR2/lgwHW/r2eiRybpJ8w svGzMT7rT9s7q2QIEzDhMCf68s1oZlO/y9ZHmDMO66gCjtllNfbysHZsbAFbHnYskB1+ hWasqafW9z8si8yAXecz76+Elw5QXcBiqDfGNWjoy1LVRH0mcy4r69QxSYcvwBaiE89Y JAbRjtpyBdR6GUhiql0T2LrGWlx9W6EWM+2+wieK3hzwzpvMoQIdltFJnq/jN2qW+9EN YsZmoiOeRkS0/D0IwxmeaT+RmabKaN4JsJdwsTJk1t3FYo7d1HkIsNwLdlcv1PyAWBGM RgMw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-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. [23.128.96.19]) by mx.google.com with ESMTPS id oo16-20020a17090b1c9000b001c7c69ce93esi13651068pjb.13.2022.04.12.12.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 12:49:06 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A943666224; Tue, 12 Apr 2022 12:44:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346577AbiDLO2N (ORCPT + 99 others); Tue, 12 Apr 2022 10:28:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356506AbiDLO2N (ORCPT ); Tue, 12 Apr 2022 10:28:13 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E49C656C04 for ; Tue, 12 Apr 2022 07:25:53 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Kd7JL50xNzgYhP; Tue, 12 Apr 2022 22:24:02 +0800 (CST) Received: from kwepemm600015.china.huawei.com (7.193.23.52) by kwepemi500012.china.huawei.com (7.221.188.12) 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:25:51 +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:25:50 +0800 Message-ID: Date: Tue, 12 Apr 2022 22:25:49 +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 v2 3/5] NFS: Don't report ENOSPC write errors twice From: "chenxiaosong (A)" To: Trond Myklebust , "linux-nfs@vger.kernel.org" , "trondmy@kernel.org" CC: "smayhew@redhat.com" , "zhangxiaoxu5@huawei.com" , "yi.zhang@huawei.com" References: <20220411213346.762302-1-trondmy@kernel.org> <20220411213346.762302-2-trondmy@kernel.org> <20220411213346.762302-3-trondmy@kernel.org> <20220411213346.762302-4-trondmy@kernel.org> <5fde4fd533805990cfbd0f23964db786cfda2cd7.camel@hammerspace.com> <3536f67c-95f3-efbf-3d0f-0b7e8b4549b9@huawei.com> <52552874-01a4-d0da-8904-1b81659e5d1c@huawei.com> In-Reply-To: <52552874-01a4-d0da-8904-1b81659e5d1c@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.52] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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-nfs@vger.kernel.org 在 2022/4/12 21:29, chenxiaosong (A) 写道: > 在 2022/4/12 21:13, chenxiaosong (A) 写道: > On other filesystem, wb error is only cleared when doing fsync() or sync > write(), it should not clear the wb error when doing async write(). Your > patch will clear the wb error when doing async write(). > > And my patchset mainly fix following problem: > > filemap_sample_wb_err() always return 0 if old writeback error > have not been consumed. filemap_check_wb_err() will return the old error > even if there is no new writeback error between filemap_sample_wb_err() and > filemap_check_wb_err(). > > ```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 > ``` > After merging your patchset, NFS will report and clear wb error on _async_ write(), even there is no new wb error while nfs_wb_all, is this reasonable? And more importantly, we can not detect new error by using filemap_sample_wb_err()/filemap_check_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 ``` .