Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp588198rdg; Tue, 10 Oct 2023 22:16:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZILiA03ql8uR/XIVPx01XLDun0Yl/yoyVu49Q3+YLvjAO/95a2jP2nHnw4ALyEX9K79VA X-Received: by 2002:a17:90b:4c07:b0:262:d661:2963 with SMTP id na7-20020a17090b4c0700b00262d6612963mr16730281pjb.39.1697001373256; Tue, 10 Oct 2023 22:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697001373; cv=none; d=google.com; s=arc-20160816; b=H4HmZag/QEboOXZqnrBLp05jNtgKNN4ZZgtSG8txy1a9wNlTLn6PSvsobSSe6C61Gc 9FSY7p79oSBrRhid+sMPPgEJCHSt/urWpqZtxqF0UwYdsh2lx4c85zTU7kTzuPjqO7pX Wz1VHf4eh0Q1hQ9egJDFL3FpaWtcujN2FXFx+knM5bKkKTNWSaJtcQVBdNCiYmFV0J3c 8F6Y0renlzCiG6Mupj8Fur0I3VicZfcVakafThao97VF7VknxY2uoFRPf1gSlUWb3sCi EyEhvaSsbE01aGvaVl+IPxql+d+HnmWDX5b47a3psx23ONVX0v1akcSQ7MQd9QnWH/bm wLGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=sF9gazo37wlzVi1cJeo+H2C/bzJkmsUXqEo9YfoPyNw=; fh=a34eu72gbxH/s+HaSzGGNYvG7vjnazyS57/a3xcYRNU=; b=q0ofkv++1FW4fYLIy1tDHXOhyX3Cf+74CNTeKpRU46dTrwNGxaJJLiFxTG/a9kqz5v PwXaLgmKEPK11HliLCV/zGp85/0HXS1QlY0t1ogggthN4CEZH6JhsLO0HnGZU2mucDf5 vDeUV/9vZcn2N9PBL757gcNlcgd9Zzj84zxba2GqvSv2p0Ru1UQFqeDJTLOyfKdR08Ey vyuWBieUe86YU1PisT+M0Y6ZodnoBLLnBo4tyLjSIRtAfCDsSUIl42JIdfwVfvgiaPoh KppVwmVQuhIH/coP42nDfEMZ6+prqWD5cO76+UZI6Cu4/QcCXuvY9LOdjFiWctppMfSX zYkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=PnQdgOqB; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id mg9-20020a17090b370900b00278f79e4fabsi570689pjb.93.2023.10.10.22.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 22:16:13 -0700 (PDT) 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=@suse.de header.s=susede2_rsa header.b=PnQdgOqB; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 797BE8025B49; Tue, 10 Oct 2023 22:16:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbjJKFQI (ORCPT + 99 others); Wed, 11 Oct 2023 01:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjJKFQI (ORCPT ); Wed, 11 Oct 2023 01:16:08 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C21909E for ; Tue, 10 Oct 2023 22:16:06 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7CA5121861; Wed, 11 Oct 2023 05:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697001365; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sF9gazo37wlzVi1cJeo+H2C/bzJkmsUXqEo9YfoPyNw=; b=PnQdgOqByoKef3iS7xRQtBGTaQj5THJm1EFNHSlQN3A1fpM4K0q+ZxPG2uKYNUKjIDHquU eqEt4srN1oii9pbWN1ljI/DjEa8wPy3phdcDg9p3Rkpb0PCz3+8QRH+XDCNuylgsXSeWOB pjigTweniJSdpd5xBU4/1OQw9/noR3Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697001365; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sF9gazo37wlzVi1cJeo+H2C/bzJkmsUXqEo9YfoPyNw=; b=Q82xK+sYopeUVQCI7GXvbw6EesJA2a54XCuiDEdmVhNIUwOMh31FdIHI8FGcriRyJaP5AA IH8EmhPiBTj1dOCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3E57E13586; Wed, 11 Oct 2023 05:16:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0cd9OJMvJmVmQgAAMHmgww (envelope-from ); Wed, 11 Oct 2023 05:16:03 +0000 From: NeilBrown To: Steve Dickson Cc: linux-nfs@vger.kernel.org, Trond Myklebust Subject: [PATCH 0/3 nfs-utils] fixes for error handling in nfsd_fh Date: Wed, 11 Oct 2023 15:57:59 +1100 Message-ID: <20231011051131.24667-1-neilb@suse.de> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Tue, 10 Oct 2023 22:16:09 -0700 (PDT) X-Spam-Level: ** When the kernel ask mountd to map the fsid from a filehandle to a path name the request is handled by nfsd_fh(). The kernel expects to get a definitive answer - either a path name or an clear statement that there is no path name. However mountd sometimes cannot give a definitive answer - it wants to say "ask again later", but it cannot. One case that it wants to say "ask again" is when a 'stat' of a mountpoint fails with a non-path-name error. This might mean that a re-exported NFS mount is having problems. The code for handling this case is incorrect. mountd potentially scan every moint point. If any mount point matches the fsid, it should succeed even if some other mountpoint appears to have problems. Instead assumes failure is *any* mountpoint has problems. The first patch fixes this - so now the error handling is only triggered if no matching mount can be found. This list of errors that are considered "path-name errors" does not included EACCES. This error can be returned, e.g., by fuse filesystem that only allow a single use to have access. The should be treated as a path-name error. The second patch fixes this. However this still leave the error handling to be wrong. The response when no match is found and at least one questionable path is seen, is to not send a response to the kernel. The result of this is that the kernel never asks again. It return NFS4ERR_DELAY (for NFSv4) to the client, but doesn't ever re-queue the request as the request is already queued. There is no way to tell the kernel "dequeue this request treat the lookup as failure". The third patch proposes a machanism to do this. It returns a negative result to the kernel with an expiry time in the past. This could reasonably be interpreted as "dequeue the request but do return a definitive result". The kernel doesn't currently treat it like that. Rather it treats it as definitive just once, and will ask again for the next request. But that will only come after the client has seen a failure. We could easily change the kernel to respond differently, but we would need to think carefully about the behaviour on older kernels, and about the possibility of a much higher rate of fsid lookup requests being sent from kernel to mountd. So the third patch is just an RFC. The first two patches are, I think, suitable for immediate release (subject to normal review). Thanks, NeilBrown