Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2576681rdb; Wed, 15 Nov 2023 05:04:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIccmg7kaI9kIWKHasIPftnmAQmhpdWyhLMtkJBnFbWOoZTUikVFDpbMlQWIrJMb5W9Wo1 X-Received: by 2002:a17:90b:4f84:b0:280:892a:75ab with SMTP id qe4-20020a17090b4f8400b00280892a75abmr7970313pjb.10.1700053458597; Wed, 15 Nov 2023 05:04:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700053458; cv=none; d=google.com; s=arc-20160816; b=pERV03jTuzdweS0bgGABXqCxGkmMCjHOh/j/1IP0RY0VsPg1U1iPp3J2j4tS/zyE9B iAqCXrFTZcK/1vXvCi7VKJLtzdlwdeNUI4op2h3vXt3o5vXYJ9hdhoFd5xQM4ikAHb8i 5QJvwf6o4aRb16qfENqoBRQplyBUzxEmaEjlvZUv1kMWTIST3shI04uKFi1Qc9MgFePE +7M6ttdc0jW9ym1XyZxUGemqxSs+hjmTq+j9mvQG1EHCyiFIRJtj8QbWcdpE19aML7Nr ArBbXQHCk3WJZCcvTOMr3F/EcPdP8YdMaj7S0KW+1+gqvotCqOvWLdq0dDkrhlh0QOmb iBlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Pr8NpsOMIWoyxbrZ06FUm/LGBngldfoFEWe1o99nokk=; fh=nQvMWqQ/v0LpI35XLl1r5rtkfHXKzYQJKYxV+U6EVJc=; b=w+IdWEHxkk0X3LyltUKLFOJ37V71BxzRlE//Ep4K/3latmKYmKXeq7k43v9AzRFytZ 3iaOpiP+AYwKvIX+2koFo71D0buUlpjJuzgJRpFwOZAnqtQdKJldc0sn/M2ndZfSmIAL u+ykyq/Q/Ke/Ad/2B8xVUH9jHqgVZvuy/2sLTZ6kuQlo1Z+mTcS6ILncVQsmxa6SZpP5 wnvKvF2K0W3t4M07HqYl3s2U1AYcMda3oAXmR/sGUZ7/FDitebkm1xOBlOYnjMudoIdm kLknbvyp5kO3iCNXy7HCfjbcPjigOX8Fr2J2cTf1lHvjWmXxxJKYVI3yID87kMVVgBcy V2rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ftdlH/Hj"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y5-20020a17090aa40500b0027d1ce4ce41si1376348pjp.0.2023.11.15.05.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 05:04:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ftdlH/Hj"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 830E5808E648; Wed, 15 Nov 2023 05:04:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234922AbjKONEN (ORCPT + 99 others); Wed, 15 Nov 2023 08:04:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234924AbjKONEM (ORCPT ); Wed, 15 Nov 2023 08:04:12 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19EDBCE for ; Wed, 15 Nov 2023 05:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700053448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Pr8NpsOMIWoyxbrZ06FUm/LGBngldfoFEWe1o99nokk=; b=ftdlH/HjMs9JkZeZvWrQZLa6IjN9T3ZRxftLrG7giKfgo8tkzgumCEQzkUmnLtZR9W8x2s wRGjpQCsgFS627mprAIDHePDAQ208ZuSvxlckq0QC79JTsdK3TT+qVkw4ouqrk6b2q76jq o+u+NvcJdnKpZxT4xObZXYSxuWWG8zI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-455--xopn-H1Pg6Li07s4lTgDA-1; Wed, 15 Nov 2023 08:04:06 -0500 X-MC-Unique: -xopn-H1Pg6Li07s4lTgDA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32B801C06E10; Wed, 15 Nov 2023 13:04:06 +0000 (UTC) Received: from [100.85.132.103] (unknown [10.22.48.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C6C81121306; Wed, 15 Nov 2023 13:04:05 +0000 (UTC) From: Benjamin Coddington To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, anna.schumaker@netapp.com Subject: Re: [PATCH v2 1/5] NFS: Fix error handling for O_DIRECT write scheduling Date: Wed, 15 Nov 2023 08:04:04 -0500 Message-ID: In-Reply-To: <4EBFA030-C144-4017-842F-B8D6B2ADC19A@redhat.com> References: <20230904163441.11950-1-trondmy@kernel.org> <20230904163441.11950-2-trondmy@kernel.org> <02FDFFF6-8512-4BBA-845D-72C21864E621@redhat.com> <44d134dd65a4c7194f5200a390e5229003ba4016.camel@hammerspace.com> <4EBFA030-C144-4017-842F-B8D6B2ADC19A@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 05:04:11 -0800 (PST) On 9 Nov 2023, at 12:25, Benjamin Coddington wrote: > On 9 Nov 2023, at 11:53, Trond Myklebust wrote: >> >> Hi Ben, >> >> Relying on the value of dreq->bytes_left is just not a good idea, given >> that the layoutget request could end up returning NFS4ERR_DELAY. >> >> How about something like the following patch? > > That looks promising! I think ->bytes_left could get dropped after this. > > I'll send it through some testing and report back, thanks! This definitely fixes it, sorry for the delay getting back. Fixes: 954998b60caa ("NFS: Fix error handling for O_DIRECT write scheduling") Reviewed-by: Benjamin Coddington Tested-by: Benjamin Coddington It creates some clear additional work to remove nfs_direct_req->bytes_left (I don't think its needed anymore) and fixup the nfs_direct_req_class tracepoint, which could be a follow-up patch or get folded in. Ben