From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.4 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B9E6C2D0DA for ; Mon, 30 Dec 2019 04:56:21 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFA5820663 for ; Mon, 30 Dec 2019 04:56:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nhx9yGrk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFA5820663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C81C881E5F; Mon, 30 Dec 2019 04:56:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ymaRPZHIZ7_w; Mon, 30 Dec 2019 04:56:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 10A7280732; Mon, 30 Dec 2019 04:56:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0066FC18DC; Mon, 30 Dec 2019 04:56:20 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id E277AC077D for ; Mon, 30 Dec 2019 04:56:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DF82784317 for ; Mon, 30 Dec 2019 04:56:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1FxjkZ3pyopw for ; Mon, 30 Dec 2019 04:56:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id E4ACA810C7 for ; Mon, 30 Dec 2019 04:56:16 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id a6so7333606pjh.2 for ; Sun, 29 Dec 2019 20:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dY9unxVIr1tFCym7yEPAegK01Wyg01REeRtJSgLyB00=; b=Nhx9yGrk/hiwe8aILWqRgvfXThj0aKHy6BnIgETzV8XYxGFzZsHf9Brvb3qiEBJRUs TZhr3vPPWJUyUYpN0XxRHZ0uk00jr0PjXAdNqN6A1hdDpDPMByZrSAKdfC2HbxiXGPQG Q1gv28vYYIBpJpeOAjuPWDOE3O9HblDrJsofmjqhnZ+3TsWZwOR2c47U1GS7w0yHKXDf B8vcN44BZmbpNy2HqH2plxG+lPTRomP4jAJfil19YGL3vbAmlN/dkl7nHi0OXAUOfVOK 7as00zT1BawyjhX99PFgKqiA5EmxTD1pfkEdBI0FJiZ/1TH0meiXqUoWZbCK5h5BhENz yzrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dY9unxVIr1tFCym7yEPAegK01Wyg01REeRtJSgLyB00=; b=nm0pk3t3yS3TaBaelXrZyye7+TQuh07UYeW9ezWITj4Btu4kMvFRpsrSwDxO+TaK5c i38wz6rz58yjE6RplOUAz1AwgrN7LI+44Pftp89R47x6opoJ3h+Jav4eM8n7ABU1i75e rCPGdvkvTKcmO6SrKIMDRV1pWwf2iOLHmlRXkumCbSHwKX46Sr2W0XNyP4qJf47FJdNH kbGwZsUxNYNIDyPOvvc2AhbUtSmzM9Wn16VnnGxROrlK09xxroUvLjgW5rrZNtOEVfMi tXnCBbj9mnzo8x0zhyo+naiGBbo7czENuUe4rErVHXg4V5DfTRlIjedEQUjIGiaYY0W0 nr4A== X-Gm-Message-State: APjAAAXrDoXqQ1CZ1SPK+mxHWhQU6jjpXKuyKA4nkMJO6j1KsTc2WLQS QZPdDXNs/hQt6oOXo4HAX/0= X-Google-Smtp-Source: APXvYqxH3MqnmjsN2hFwerrUYmPPPY8LNaFO92h/3dT3MlrFw03H7ieID0ljV03KUaP/PmilRPipNg== X-Received: by 2002:a17:90b:142:: with SMTP id em2mr43611360pjb.4.1577681776431; Sun, 29 Dec 2019 20:56:16 -0800 (PST) Received: from localhost.localdomain ([2804:14d:72b1:8920:da15:c0bd:33c1:e2ad]) by smtp.gmail.com with ESMTPSA id b1sm22373189pjw.4.2019.12.29.20.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Dec 2019 20:56:16 -0800 (PST) From: "Daniel W. S. Almeida" X-Google-Original-From: Daniel W. S. Almeida To: corbet@lwn.net, mchehab+samsung@kernel.org Date: Mon, 30 Dec 2019 01:55:55 -0300 Message-Id: X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 Cc: linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, "Daniel W. S. Almeida" , linux-doc@vger.kernel.org Subject: [Linux-kernel-mentees] [PATCH v2 1/8] Documentation: convert nfs.txt to ReST X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" From: "Daniel W. S. Almeida" This patch converts nfs.txt to RST. It also moves it to admin-guide. The reason for moving it is because this document contains information useful for system administrators, as noted on the following paragraph: 'The purpose of this document is to provide information on some of the special features of the NFS client that can be configured by system administrators'. Signed-off-by: Daniel W. S. Almeida --- Documentation/admin-guide/index.rst | 1 + Documentation/admin-guide/nfs/index.rst | 9 ++ .../nfs/nfs-client.rst} | 91 ++++++++++--------- 3 files changed, 58 insertions(+), 43 deletions(-) create mode 100644 Documentation/admin-guide/nfs/index.rst rename Documentation/{filesystems/nfs/nfs.txt => admin-guide/nfs/nfs-client.rst} (72%) diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guide/index.rst index 4405b7485312..4433f3929481 100644 --- a/Documentation/admin-guide/index.rst +++ b/Documentation/admin-guide/index.rst @@ -76,6 +76,7 @@ configure specific aspects of kernel behavior to your liking. device-mapper/index efi-stub ext4 + nfs/index gpio/index highuid hw_random diff --git a/Documentation/admin-guide/nfs/index.rst b/Documentation/admin-guide/nfs/index.rst new file mode 100644 index 000000000000..f5c0180f4e5e --- /dev/null +++ b/Documentation/admin-guide/nfs/index.rst @@ -0,0 +1,9 @@ +============= +NFS +============= + +.. toctree:: + :maxdepth: 1 + + nfs-client + diff --git a/Documentation/filesystems/nfs/nfs.txt b/Documentation/admin-guide/nfs/nfs-client.rst similarity index 72% rename from Documentation/filesystems/nfs/nfs.txt rename to Documentation/admin-guide/nfs/nfs-client.rst index f2571c8bef74..f01bf6a6c207 100644 --- a/Documentation/filesystems/nfs/nfs.txt +++ b/Documentation/admin-guide/nfs/nfs-client.rst @@ -1,3 +1,6 @@ +========== +NFS Client +========== The NFS client ============== @@ -59,10 +62,11 @@ The DNS resolver NFSv4 allows for one server to refer the NFS client to data that has been migrated onto another server by means of the special "fs_locations" -attribute. See - http://tools.ietf.org/html/rfc3530#section-6 -and - http://tools.ietf.org/html/draft-ietf-nfsv4-referrals-00 +attribute. See `RFC3530 Section 6: Filesystem Migration and Replication`_ and +`Implementation Guide for Referrals in NFSv4`_. + +.. _RFC3530 Section 6\: Filesystem Migration and Replication: http://tools.ietf.org/html/rfc3530#section-6 +.. _Implementation Guide for Referrals in NFSv4: http://tools.ietf.org/html/draft-ietf-nfsv4-referrals-00 The fs_locations information can take the form of either an ip address and a path, or a DNS hostname and a path. The latter requires the NFS client to @@ -72,16 +76,16 @@ upcall to allow userland to provide this service. Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual /var/lib/nfs/rpc_pipefs, the upcall consists of the following steps: - (1) The process checks the dns_resolve cache to see if it contains a + #. The process checks the dns_resolve cache to see if it contains a valid entry. If so, it returns that entry and exits. - (2) If no valid entry exists, the helper script '/sbin/nfs_cache_getent' + #. If no valid entry exists, the helper script '/sbin/nfs_cache_getent' (may be changed using the 'nfs.cache_getent' kernel boot parameter) is run, with two arguments: - - the cache name, "dns_resolve" - - the hostname to resolve + - the cache name, "dns_resolve" + - the hostname to resolve - (3) After looking up the corresponding ip address, the helper script + #. After looking up the corresponding ip address, the helper script writes the result into the rpc_pipefs pseudo-file '/var/lib/nfs/rpc_pipefs/cache/dns_resolve/channel' in the following (text) format: @@ -94,43 +98,44 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual script, and is the 'time to live' of this cache entry (in units of seconds). - Note: If is invalid, say the string "0", then a negative - entry is created, which will cause the kernel to treat the hostname - as having no valid DNS translation. + .. note:: + If is invalid, say the string "0", then a negative + entry is created, which will cause the kernel to treat the hostname + as having no valid DNS translation. A basic sample /sbin/nfs_cache_getent ===================================== - -#!/bin/bash -# -ttl=600 -# -cut=/usr/bin/cut -getent=/usr/bin/getent -rpc_pipefs=/var/lib/nfs/rpc_pipefs -# -die() -{ - echo "Usage: $0 cache_name entry_name" - exit 1 -} - -[ $# -lt 2 ] && die -cachename="$1" -cache_path=${rpc_pipefs}/cache/${cachename}/channel - -case "${cachename}" in - dns_resolve) - name="$2" - result="$(${getent} hosts ${name} | ${cut} -f1 -d\ )" - [ -z "${result}" ] && result="0" - ;; - *) - die - ;; -esac -echo "${result} ${name} ${ttl}" >${cache_path} - +.. code-block:: sh + + #!/bin/bash + # + ttl=600 + # + cut=/usr/bin/cut + getent=/usr/bin/getent + rpc_pipefs=/var/lib/nfs/rpc_pipefs + # + die() + { + echo "Usage: $0 cache_name entry_name" + exit 1 + } + + [ $# -lt 2 ] && die + cachename="$1" + cache_path=${rpc_pipefs}/cache/${cachename}/channel + + case "${cachename}" in + dns_resolve) + name="$2" + result="$(${getent} hosts ${name} | ${cut} -f1 -d\ )" + [ -z "${result}" ] && result="0" + ;; + *) + die + ;; + esac + echo "${result} ${name} ${ttl}" >${cache_path} -- 2.24.1 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees