Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2846978rwb; Mon, 3 Oct 2022 06:27:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6cSA/mJgHSJ8hf+RDScGZRgVvPjkmKWctm2ZZVGtRW9IEUBHO6orhIcpWetpyHT9HvvKp8 X-Received: by 2002:a63:1c5e:0:b0:448:9acf:589b with SMTP id c30-20020a631c5e000000b004489acf589bmr9019625pgm.202.1664803645989; Mon, 03 Oct 2022 06:27:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664803645; cv=none; d=google.com; s=arc-20160816; b=dgGgLKKTI2rtSb/GeH9pQNg+b2JijGhaXqWm9SkeSnjlNfE9MwmySNASnBvshmmbOG 3s+RY8jAiQwtyCuiDwqSKsvQ1Qli9mTRo/DVdARivilm2eA70cfV2eLZjVLuygoAdLfH lBowqfCYIiaCOyzE0G6ZjJkpmyGV4k9eDKls8L/rhs75nOPp4OsX9+FNfNPsdCWn1Se0 ierl2dfanWmmT2BQ2TjKs+wY+kXtl371S931CZBml/VP238dkKZu6FuSlWTkppQE4UQ4 z/IP56ykVvlR2XJiR5wuFhN73IkcWdyWv92rU3zk3mNhvRDv5cBQXb2A+HKnvoZmvvM9 fXQA== 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:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=JhbeSGBBgEjn4zl6lPkRoAAxHsAUKWQXrrxy6c8tLww=; b=mFs5G+LPaD0+QfPrCcDW8FcElFP4jJAUkp7szHQvj2JPev9d9q+hFoaiN5GtEjQ21v 73fsCU3Up0UeX9l5UZqqB8X+Jul05UHHH+PbJUFuGWQY56YQq4T01NBeSbHM4VE3HNck 9FMyrLXHULtYNNbPUb0UHYjsc9ItZxwByOBtCXhSOUcbjwAl3lA4+Y1ixm+OwidT4a+7 y+SKZ/J/AX2GvP+qZJ+HwuvB7dtPyxqj7LnJgfjN67DHVbFOFmr0fuqLsxTxp7Y1kapI NEZTJM8A+ix+tbA64xGwlKnlC9M4Mlpy1fDnY/FqWJT5UBIdpYP45Au2a1zdEGN/Tfxu bG6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=bCoW7ZsL; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020aa79094000000b005615ef4cfccsi2982935pfa.185.2022.10.03.06.27.06; Mon, 03 Oct 2022 06:27:25 -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=@gmx.net header.s=badeba3b8450 header.b=bCoW7ZsL; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229521AbiJCNZl (ORCPT + 99 others); Mon, 3 Oct 2022 09:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbiJCNZP (ORCPT ); Mon, 3 Oct 2022 09:25:15 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAA4D205D0 for ; Mon, 3 Oct 2022 06:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1664803496; bh=bJ0KfBG1IMZSzm3eGCdJShyzO6MjfktMVcXhGqXnQTE=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=bCoW7ZsLb0a3cUVSthOtWUzzsajdh3Gb03tVpu3hEoxMpgNGvs/s/iYBoQ9+rV3hf quluXxXUSapeOhwpnrHn1/K6r7vBwloB5gT/+j8gLxy38sb55bcdCsDsxQwhH0iuMH CVOPzhuAroWXaAC/rQy07lgFhQHDnPPWbvswpZCw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.99.12] ([212.126.164.126]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MeCpR-1pFEUR0J55-00bKet; Mon, 03 Oct 2022 15:24:56 +0200 Message-ID: Date: Mon, 3 Oct 2022 15:24:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: nfs4.1+: workaround for defunct clientaddr? Content-Language: de-CH, en-US To: Jeff Layton , linux-nfs@vger.kernel.org References: <39bf58c7-47d9-744b-6d26-d672aa713024@gmx.ch> <8cd63730f7b5f3e2aa3bde98587de0c6a42b384b.camel@kernel.org> <8550c032-2ef8-4ddb-19a0-307777bd9645@gmx.ch> From: Manfred Schwarb In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:WxAXcg5bvT8I4KIA+qvCddklHHNslnoHRGuTbuQcPiAKUykbfKo aqTsv+ZJBiVsc9z9xGUHm0n8MhVgM/th8pJZeTVtfh21TkHAxQljTbgWstsbrbcSFZQ6l7z Ao1Ky6NALVzWSxRoseZ30ID6z16gLW9zNkY9kB4014g9JIzqjN8QY1Hofddd3x3McJGLxIu 6uF4ihsqP3KsDvSTRlhdw== X-UI-Out-Filterresults: notjunk:1;V03:K0:2+IjFz1rTv0=:i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nvbhNf/XSJSQb1MIKdu5ylAsVgQmP0hJuL/zrQYWAR n1jOXBgSYCA6oAEtJHNjTamNmf4vPtTXq/gAqtrvBRiwz1aoNBimcAmSGASQtV+0nrSrTwBik tRLzIvkmLrMVLIllru3Pz76oDQ X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS 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 Am 03.10.22 um 14:26 schrieb Jeff Layton: > On Mon, 2022-10-03 at 13:55 +0200, Manfred Schwarb wrote: >> Am 03.10.22 um 13:39 schrieb Jeff Layton: >>> On Sun, 2022-10-02 at 14:35 +0200, Manfred Schwarb wrote: >>>> Hi, >>>> >>>> I have 2 boxes connected with 2 network cards each, one >>>> crossover connection and one connection via LAN. >>>> I want to use the crossover connection for backup, >>>> so I want to be able to select exactly this wire when >>>> doing my NFS backup transfers. Everything interconnected via NFS4.1 >>>> and automount. >>>> >>>> Now the thing is, if there is an already existing connection >>>> via LAN, I am not able to select the crossover connection, >>>> there is some session reuse against my will. >>>> >>>> automount config: >>>> /net/192.168.99.1 -fstype=3Dnfs4,nfsvers=3D4,minorversion=3D1,client= addr=3D192.168.99.100 / 192.168.99.1:/ >>>> /net2/192.168.98.1 -fstype=3Dnfs4,nfsvers=3D4,minorversion=3D1,client= addr=3D192.168.98.100 / 192.168.98.1:/ >>>> >>>> mount -l: >>>> 192.168.99.1:/data on /net/192.168.99.1/data type nfs4 (...,clientadd= r=3D192.168.99.100,addr=3D192.168.99.1) >>>> 192.168.99.1:/data on /net2/192.168.98.1/data type nfs4 (...,clientad= dr=3D192.168.99.100,addr=3D192.168.99.1) >>>> >>>> As you see, both connections are on "192.168.99.1:/data", and the bac= kup runs >>>> over the same wire as all user communication, which is not desired. >>>> This even happens if I explicitly set some clientaddr=3D option. >>>> >>>> Now I found two workarounds: >>>> - downgrade to NFS 4.0, clientaddr seems to work with it >>>> - choose different NFS versions, i.e. one connection with >>>> minorversion=3D1 and the other with minorversion=3D2 >>>> >>>> Both possibilities seem a bit lame to me. >>>> Are there some other (recommended) variants which do what I want? >>>> >>>> It seems different minor versions result in different "nfs4_unique_id= " values, >>>> and therefore no session sharing occurs. But why do different network >>>> interfaces (via explicitly set clientaddr=3D by user) not result in d= ifferent >>>> "nfs4_unique_id" values? >>>> >>>> Thanks for any comments and advice, >>>> Manfred >>> >>> That sounds like a bug. We probably need to compare the clientaddr >>> values in nfs_compare_super or nfs_compare_mount_options so that it >>> doesn't match if the clientaddrs are different. >>> > > > Actually, I take it back, clientaddr is specifically advertised as being > for NFSv4.0 only. The workaround for you is "nosharecache", which will > force the mount under /net2 to get a new superblock altogether. But clientaddr is silently accepted on NFS4.1+, and seemingly silently doe= s nothing. The point is, RFC5661 explicitely tells "NFS minor version 1 is deemed superior to NFS minor version 0 with no los= s of functionality". So this behavior comes as a surprise. > >>> As a workaround, you can probably mount the second mount with >>> -o nosharecache and get what you want. >> >> Indeed, nosharecache works. But the man page has some scary words for i= t: >> "This is considered a data risk". >> > > Yeah, it does sound scary but it's not a huge issue unless you're doing > I/O to the same files at the same time via both mounts. With > "sharecache" (the default) you get better cache coherency in that > situation since the inode and its pagecache are the same. > So I guess this is equivalent to the minorversion=3D1/minorversion=3D2 tri= ck cache coherency wise then? > With "nosharecache" you need to be more careful to flush caches, etc. if > you are doing reads and writes to the same files via different paths. If > you need careful coordination there, then you probably want to use file > locking. Thanks for these explanations, it is appreciated! Manfred > -- > Jeff Layton