Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp57703lfv; Tue, 12 Apr 2022 17:09:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgUbbdkAab9Z/bCAFB5hUT7zjw3ayGxEv/ODRd6PANgS1eW9oKc04JnYZNpJ4OrZiTVZ1p X-Received: by 2002:a05:6a00:1a91:b0:4fa:b21d:2ce with SMTP id e17-20020a056a001a9100b004fab21d02cemr7124124pfv.75.1649808554897; Tue, 12 Apr 2022 17:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649808554; cv=none; d=google.com; s=arc-20160816; b=0RUVg0i9DU6gMpnTjtEKikxobTAjVOR9UNYTn8I4HBsAPMmnCzow/fSnInAeNRzwIv RHV7YU4lvfHQfIA8ozn8mmBD3Vg+cwrWD6YSQujN79nw4e552/98QtsR5/uPeLP5aV3O rKPNFXMT+qWZYFc2SHptLf494NjSVy0z6vsqjLS4eBpRujINOVwNM4XlQXkfTme6oQLH ZKMi5m9uYywZyVRy/bScul0IckTBPvxyeM4yjWpwPLbRMG+PDWC4o+ATXqL3vYfowFFg HaRYtG20wRq4fI4VPENYK+qV9WoqhiMNOxiO/YNq5aGLQ2mZkJPC/HRpjGF4xgkAatej Lbhw== 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=8joRwncWXIt3TDhyad/2WwmfVr46lB4JOehqeKE6i3Q=; b=ipQ3rzlrVbHIL+9wri7wJqXIUQPzVzl8xdHMP31RaC3WrZAKPxV1zjiZDu+fUoZMHn mivYzK4j3l8iQ4BH/E11X5cAOkcGXKxsfknqgKgsv5aP5UpYp9JCM8/l34boJ5gIj0Mt XcfeKSl7Czj+mBu2j6KiNOmXgybdYlsGqXqHlhc1awlYpMAGpqM5DBUjrz8gmQBRI37h AIhwZAiAb/kWUln3NREYpiiGBxn/YmvCU/bPCn6LEtbhnRBoY1ct+CncBC7KIqnR3d+T nt/mbVqCscttFPZm1EUH8dRsdPwEuBoSy47gFPztLxevAOIF+NLtEGqfOyoHRRkHwGAy r+Cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p26-20020aa7861a000000b00505ff4b82e7si2586401pfn.368.2022.04.12.17.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 17:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 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 69FC6160FCF; Tue, 12 Apr 2022 15:28:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355515AbiDLNYa (ORCPT + 99 others); Tue, 12 Apr 2022 09:24:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355991AbiDLNWt (ORCPT ); Tue, 12 Apr 2022 09:22:49 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C0E5F41 for ; Tue, 12 Apr 2022 06:13:22 -0700 (PDT) Received: from kwepemi500024.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Kd5h03kXZzFpdQ; Tue, 12 Apr 2022 21:10:56 +0800 (CST) Received: from kwepemm600015.china.huawei.com (7.193.23.52) by kwepemi500024.china.huawei.com (7.221.188.100) 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 21:13:20 +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 21:13:19 +0800 Message-ID: <3536f67c-95f3-efbf-3d0f-0b7e8b4549b9@huawei.com> Date: Tue, 12 Apr 2022 21:13:19 +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 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> From: "chenxiaosong (A)" In-Reply-To: <5fde4fd533805990cfbd0f23964db786cfda2cd7.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: dggems703-chm.china.huawei.com (10.3.19.180) 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 20:16, Trond Myklebust 写道: > I understand all that. The point you appear to be missing is that this > is in fact in agreement with the documented behaviour in the write(2) > and fsync(2) manpages. These errors are supposed to be reported once, > even if they were caused by a write to a different file descriptor. > > In fact, even with your change, if you make the second 'dd' call fsync > (by adding a conv=fsync), I would expect it to report the exact same > ENOSPC error, and that would be correct behaviour! > > So my patches are more concerned with the fact that we appear to be > reporting the same error more than once, rather than the fact that > we're reporting them in the second attempt at I/O. As far as I'm > concerned, that is the main change that is needed to meet the behaviour > that is documented in the manpages. After merging my patchset, when make the second 'dd' call fsync (by adding a conv=fsync), it can report ENOSPC error by calling fsync() syscall. And when make the second 'dd' sync write (by adding a oflag=sync), it can report ENOSPC error too: ```c write ksys_write vfs_write new_sync_write call_write_iter nfs_file_write generic_write_sync vfs_fsync_range nfs_file_fsync ```