Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp664200iog; Fri, 24 Jun 2022 11:13:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uh4U/u2NujlJyE1A48AY5woTkMrRZoIqfOBwN+Kw103FctGgGMnjtCRM4Lj189mCdEPiSv X-Received: by 2002:a05:6402:21a:b0:431:5c52:82bb with SMTP id t26-20020a056402021a00b004315c5282bbmr486191edv.70.1656094425465; Fri, 24 Jun 2022 11:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656094425; cv=none; d=google.com; s=arc-20160816; b=dMoiRdOaBoi2kmdTSlv0zUxOV/yzuXerSY8jod/7o2jpK41fCWnGaP5PQ7HNDDlaA3 LAoBObfB+pU2LRqEtyvxczcJMYFdK2a1r4Aa/VMlCg2EGxSACd/257ydEhPOWIRAFEfa 9f5rUsYqLPjbmtLoYPYoFD6GAmW0ziAZsz4FBHXU4iguOPwGWofMAvGTseCiFR8da1kU SLkR/qOvwNGxo12qjVnJSVC2CbFCzFF2bG2IWzw9grtryQlPhWXPb3gawLhtKn4EkCuK Tovmnca3KJanLcgauGI2Iqy6Ms9awh50s5ekBw58Oa7epSY7x3a5T7cDKYwpRkaAnpZs AjNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wAQojX1oqwjkYLQYppGXb/NawNxZt5fbj1r9zGFFljY=; b=a2vaIEiycxB+9umSsZk/OGRg0GMgre9GNvLTAxQeEZg4cAsRg3zpei8lp7tz5vb+nB YCNRK5AiY8E3kqQiFqNtGBO4Abcjv1wRjq99rl35d69fvPhYl2vAl1m6B6bvnFW4HMSs Y006Bb6avPPQG/6ubCDmJqnFzhfWCjr3hhgs1dAoIWQpAiivprUE3BHvzCXAyvTPGHfa 5t7BGR4WgWar1udJNWIxPhzjxYyewZlmMpee/POS75bYjNDCKoqzvfPCc4Adr4BVaihY U9t4RmoYuK1zZ7lm0iVbQAFozs/jwvPUjqr0szHPggqsq0jow85q554QbLaVtt4wXYQL Zvdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jExaLb7N; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he9-20020a1709073d8900b00711d49f9985si2130664ejc.755.2022.06.24.11.13.10; Fri, 24 Jun 2022 11:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jExaLb7N; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230355AbiFXSNH (ORCPT + 99 others); Fri, 24 Jun 2022 14:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbiFXSNG (ORCPT ); Fri, 24 Jun 2022 14:13:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0697EDF0A for ; Fri, 24 Jun 2022 11:13:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DDB08B82AD3 for ; Fri, 24 Jun 2022 18:13:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EDBBC341C8 for ; Fri, 24 Jun 2022 18:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656094381; bh=VDCLIixVWOxc9MXXcbbzy7aCIXLOouCxo8AcTHoJ9OY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jExaLb7NchuRc5fI146r5yFGdjBTJQ8VM6UMqZ9eDrhi3zQQ6ClA+GIfbDCSoAHBZ JzIjroM8vbEDDBn5txxsgg50E8YUlDPavBMQ8lleR+AyDE6aoZjTSnuVY7dqwBbp+J Kb8JsTHHbEQn1OTfJlmd1KUIYA7Fb0oLxhO6G56blr/9pRcVK9fqaH5PqbW1s9J+HH /nLEu0bJKhOZaHEXoWh1Q0+juom3wMoxX1hxlH5JuGjF6WyxngN3FjNsBgHCk1riZ/ xfUqe+VDxbOfWuZ/KpTR6ZYeUt5YpNg3QR4ICqGPYw+JGWdcYfq4Rgp8x5U4yud6yN GWsYSPX+3kw7Q== Received: by mail-wm1-f47.google.com with SMTP id p6-20020a05600c1d8600b003a035657950so1955633wms.4 for ; Fri, 24 Jun 2022 11:13:01 -0700 (PDT) X-Gm-Message-State: AJIora9qfdgde+FJ+Y/FRvn5UT4bqVP1CtKV8OyR9zj52oCVO9H/+ass lXfxHILD9tJbros7oYNyti/Lxf83gdzDC5f93pc= X-Received: by 2002:a05:600c:2197:b0:39c:5e32:be2c with SMTP id e23-20020a05600c219700b0039c5e32be2cmr5421002wme.41.1656094380188; Fri, 24 Jun 2022 11:13:00 -0700 (PDT) MIME-Version: 1.0 References: <20220624154737.1387850-1-anna@kernel.org> In-Reply-To: From: Anna Schumaker Date: Fri, 24 Jun 2022 14:12:44 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] NFSD: Don't continue encoding if READ_PLUS gets confused To: Chuck Lever III Cc: Linux NFS Mailing List , Bruce Fields Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Fri, Jun 24, 2022 at 1:40 PM Chuck Lever III wrote: > > Hi Anna! > > > On Jun 24, 2022, at 11:47 AM, Anna Schumaker wrote: > > > > From: Anna Schumaker > > > > If we were in a HOLE segement, but vfs_llseek() claimed we were encoding > > DATA then we would switch over to the DATA encoding function. This > > conflicts with Chuck's latest xdr cleanup patches and can result in a > > crash or silent hang. Let's just return nfserr_io if we find we are in > > this situation, which will cause the encoder to return to the client > > with the number of segments already encoded. The client can then try the > > READ_PLUS call again. > > > > Fxes: 6c254bf3b637 (SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer()) > > checkpatch complains about this tag. Okay. I'll look into that. > > Also, Bruce said he wasn't able to reproduce the issue on > 6c254bf3b637, only on the whole series. Were you able to hit > it with just this commit applied? I've been having trouble hitting it in general. I think I only got an oops once, but most of the time it just silently hangs. I'll try a bit longer to see if I can hit it again. > > > > Signed-off-by: Anna Schumaker > > I find this somewhat problematic. I can't apply this patch in > good conscience: > > * The usual guideline for applying a workaround upstream is > that there's been a demonstration that it will be impossible > to find and fix the real problem. I don't see that here. > > * We still don't understand the failure. The XDR code itself > might be broken? Therefore we don't understand if this > workaround is 100% effective > > * Usually with a workaround, there's a hint of a long-term > fix... is this the long-term fix? No, the long term fix is my new READ_PLUS code. I'm hoping to have a v2 ready soon, but I tested v1 and didn't have any problem (no oops or silent hang) > > In other words, I might give this patch to a customer who > needed to get back on her feet quickly. I'm hesitant to take > it as an upstream change without further justification. > > IMHO a fix in an XDR consumer (like READ_PLUS) needs to > demonstrate that the current XDR code is working as designed. > Otherwise, the XDR code itself is what needs to be fixed. > > > > --- > > fs/nfsd/nfs4xdr.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c > > index 61b2aae81abb..dc97d7c7e595 100644 > > --- a/fs/nfsd/nfs4xdr.c > > +++ b/fs/nfsd/nfs4xdr.c > > @@ -4792,7 +4792,7 @@ nfsd4_encode_read_plus_hole(struct nfsd4_compoundres *resp, > > if (data_pos == -ENXIO) > > data_pos = f_size; > > else if (data_pos <= read->rd_offset || (data_pos < f_size && data_pos % PAGE_SIZE)) > > - return nfsd4_encode_read_plus_data(resp, read, maxcount, eof, &f_size); > > + return nfserr_io; > > count = data_pos - read->rd_offset; > > > > /* Content type, offset, byte count */ > > -- > > 2.36.1 > > > > -- > Chuck Lever > > >