Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp568207pxf; Wed, 24 Mar 2021 10:32:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0KZldQrK8i8RaNUo37XQBB23Qcz9LuFka/8sZIduj9Xb4lXWdi6ERNxgfy76IYknuq+iR X-Received: by 2002:a17:906:16da:: with SMTP id t26mr4941439ejd.270.1616607123751; Wed, 24 Mar 2021 10:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616607123; cv=none; d=google.com; s=arc-20160816; b=XqSyIA/5UaYItpyiZl7FgYvo/dlXVukfJvxaIbwZoNu9Jf5bZBDA4mYkUda7/bXvQP boc3nxCdfRCSrc9RieFIlkCYDl5W0KuIstRHpO368YrpznNApyEBg1ufiGB6wf89G9Wt ihs8ladfywOrZ8Zxu7bpr9pLAk6q9Pj478PC99gTauu6tOCuxXPL+duF0/gD8W1h9dwJ vNHWUHgPhpb2lNeYmq7BanFez7EXH2/ntP5jCszang1cOMDPpyJeiJ7F4d8WZ6NpDVfE ACNupSpXeu2014Y2VZDosF/IwOxeL24TwYGlfiV339lPCgxcJEpZrx5Giie3bDhpPEMz lPQg== 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=HzloVD6BI47C/aIBi/IVO0ANOr9GGQH9RlcCRkBuN0g=; b=EzWem5mcpOjDBFwZteGh+4s3tQcvzwoVZu9v5qywBUpq+j+mcfjt60UQkOi5m/7V/x l4MsFzO3iw3cN0QcWaQoYf39zU60SamfkojvvL3Q9/krn/Y0H3HWD3BK4OLFEx4DZaIv fti1UvaA2EOEBtiOb1DB3JKiOZKg9L5hM4Lo+8ISX2iUO53iM+fn+oOqbR3TFlP/njQQ 44oXzz7uEZNBP1w25uezZw69BnKGpo2kJ1EhHYLpg23HxBPMbrhqBk1rrx1N50wtD2KO n5lsUwARd+deqpaa2WSgl+2/GteKrR3CWWf6CvqpxNBfIXCj5pOk1z/B84M+gyBOB+kA +lUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=rO0S7X65; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x21si2255056eju.471.2021.03.24.10.31.33; Wed, 24 Mar 2021 10:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=rO0S7X65; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237143AbhCXRat (ORCPT + 99 others); Wed, 24 Mar 2021 13:30:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237122AbhCXRaN (ORCPT ); Wed, 24 Mar 2021 13:30:13 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1B87C061763 for ; Wed, 24 Mar 2021 10:30:12 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id u21so16253059ejo.13 for ; Wed, 24 Mar 2021 10:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HzloVD6BI47C/aIBi/IVO0ANOr9GGQH9RlcCRkBuN0g=; b=rO0S7X650d+9DuBA4pjNvCinEFDZ8JLR6sjcLxpCdZIWSHxIJvZ0XbhEQR/O4oPMaB UuxwqA8RCzArJF12xShM4iXJL/oZ0lhQQqccrkIhij9t4G/kYODlg7h8qQ4toEHYmF+m k4I0xmEqJVj3ufgIClyR5t9iKHvRtRbaGffdrqolbuuoc0ruIf0Hgl26nJilxCDIRvzM is1blqg5Q9RqAQUZpze29+nuTMzsQksznEbKdH8I+BclyLC/304ORID66V62tONs7YuD uZjISaduXQ4cgyshWApG5IfnIzJcRcqKihC0EtglfJ/hDfWRPcHM8E7MOfPWmH7CG/QY OhQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HzloVD6BI47C/aIBi/IVO0ANOr9GGQH9RlcCRkBuN0g=; b=bx70sq7BZHwKhO4lMZcVNadtV5wsuejdT3DFZ5cS0p8SfYrBZ+pH8AHg4nU57bmPZp awDLJXKzrpECguM9D2Hs9tshrtdZYns6TjS0PulNXyA0+3mWc0clK1v8CdZcBZo7nII9 q6rXQYCEbCjMpNxoBehTCVxhNCW1pVwWuOstqbeO7S9IiN4hGvnQc1Xaw58GsJNaKVnl IE4ORZSHA6FNZeYfgnX9ZHcolUoyEGDtaYeTcOZM6bNFftanobSuwXow62CaWGGVkzQT CRdrC4jkE0ZLSB7/C8uuHY5ick6loUJGlT2ePUt2Qo3NI8ZQCCJN7gQ18KjHHYzeJ3Cj SdZg== X-Gm-Message-State: AOAM531Xiwc+G8AeHtRN8IJcajb0TVKiLPXrZ7s/Cu6TRopIRinusjm/ zJY14qHWL/oQiwoegRfVTNg9XYZjS6/XfNydeWA= X-Received: by 2002:a17:907:62a7:: with SMTP id nd39mr4926029ejc.510.1616607011254; Wed, 24 Mar 2021 10:30:11 -0700 (PDT) MIME-Version: 1.0 References: <20210312211826.360959-1-Anna.Schumaker@Netapp.com> In-Reply-To: <20210312211826.360959-1-Anna.Schumaker@Netapp.com> From: Olga Kornievskaia Date: Wed, 24 Mar 2021 13:29:59 -0400 Message-ID: Subject: Re: [PATCH v3 0/5] SUNRPC: Create sysfs files for changing IP address To: Anna Schumaker Cc: linux-nfs , Anna Schumaker Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Mar 12, 2021 at 4:19 PM wrote: > > From: Anna Schumaker > > It's possible for an NFS server to go down but come back up with a > different IP address. These patches provide a way for administrators to > handle this issue by providing a new IP address for xprt sockets to > connect to. > > Chuck has suggested some ideas for future work that could also use this > interface, such as: > - srcaddr: To move between network devices on the client > - type: "tcp", "rdma", "local" > - bound: 0 for autobind, or the result of the most recent rpcbind query > - connected: either true or false > - last: read-only timestamp of the last operation to use the transport > - device: A symlink to the physical network device > > Changes in v3: > - Rename functions and objects to make future expansion easier > - Put files under /sys/kernel/sunrpc/client/ instead of > /sys/kernel/sunrpc/net/, again for future expansions > - Clean up use of WARN_ON_ONCE() in xs_connect() > - Fix up locking, reference counting, and RCU usage > - Unconditionally create files so userspace tools don't need to guess > what is supported (We return an error message now instead) > > Changes in v2: > - Put files under /sys/kernel/sunrpc/ instead of /sys/net/sunrpc/ > - Rename file from "address" to "dstaddr" > > Thoughts? Reviewed-by/Tested-by this version. Works OK for me. I would like to note that the interface doesn't or rather perhaps cannot do any error checking. So if the "user" were to echo a nonsensical data into the sysfs (echo foobar > ), that breaks the existing connection. However, if a proper IP were to be entered to correct it, things will go back to normal. > Anna > > > Anna Schumaker (5): > sunrpc: Create a sunrpc directory under /sys/kernel/ > sunrpc: Create a client/ subdirectory in the sunrpc sysfs > sunrpc: Create per-rpc_clnt sysfs kobjects > sunrpc: Prepare xs_connect() for taking NULL tasks > sunrpc: Create a per-rpc_clnt file for managing the destination IP > address > > include/linux/sunrpc/clnt.h | 1 + > net/sunrpc/Makefile | 2 +- > net/sunrpc/clnt.c | 5 + > net/sunrpc/sunrpc_syms.c | 8 ++ > net/sunrpc/sysfs.c | 191 ++++++++++++++++++++++++++++++++++++ > net/sunrpc/sysfs.h | 20 ++++ > net/sunrpc/xprtsock.c | 2 +- > 7 files changed, 227 insertions(+), 2 deletions(-) > create mode 100644 net/sunrpc/sysfs.c > create mode 100644 net/sunrpc/sysfs.h > > -- > 2.29.2 >