Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp10228396ybl; Thu, 26 Dec 2019 13:20:56 -0800 (PST) X-Google-Smtp-Source: APXvYqwudG6f3BxfDj/4clPgqTS/UMqsxRNGNzrO7A2xvSMujxphVIO4sai3hyN5QzyTs+4P3Y/z X-Received: by 2002:a05:6830:1e99:: with SMTP id n25mr13594990otr.67.1577395256841; Thu, 26 Dec 2019 13:20:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577395256; cv=none; d=google.com; s=arc-20160816; b=OGxaFb+hUHb3No4Y26sjNDgbONe2wcuuJhlVwItN7D8EYdke9Da5UYDlwDE5XUfKSk kpYMlorYrGQW7kSrae6frT1ohfGlTs94F7WCzRt7LYSH6AMoWbjarAG/5u+F7jx6ri5e TLVRPoeRMe8Guwp5N7Q5l3EGEjzJrWJN/1NTvWPwL8qMb2cp8wFSUUEOzeBY9bmISzfw hdyfS/nHW+8QkkG4mz0gIBpxmrxbz0ibwXD+31klvG8ijxb0S+MfTD1WiqWEXNyUrs5A AFHNfxRaNFSnVU57vbrYsXQvrllkIVx8rjgFHmMK6vFOiezowKzbki0oyI0Z9lziyBuK 2gqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dY9unxVIr1tFCym7yEPAegK01Wyg01REeRtJSgLyB00=; b=lpa0It3prYfv4Q8W2wZODpPXJZbm26TWnA0AnyE/f9LOf0pFWJ/Wj8LWs098YhFizN Bw5yBHE5jqJt/+oUkemMjbPSL8zkpN3K7uPsBp/eiNBlPqE9aRTKkvltToBmZqduKk0z GDUd+Geld63YlsqrONNbkweI2GaTKwxjTXS8ywm+KTWPUDCMDOm6P+OSiLtP6gGUmcg5 bwc3RAkPXbnEajHL4im+7hiJILfk014ydUFIQckWAI0AHo0wiYzvxUMNAO96sjuD05J6 uzsbVwkmGhLPUOnrieA3AJkAIv38IxjQFC2gZXzUzlfHlQ20Xfi7G2o5m6WcxHjviVqm 9y4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e62A4buC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 46si17000081otu.45.2019.12.26.13.20.45; Thu, 26 Dec 2019 13:20:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e62A4buC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbfLZVUC (ORCPT + 99 others); Thu, 26 Dec 2019 16:20:02 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45042 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbfLZVUC (ORCPT ); Thu, 26 Dec 2019 16:20:02 -0500 Received: by mail-pf1-f195.google.com with SMTP id 195so12879335pfw.11; Thu, 26 Dec 2019 13:20:01 -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=e62A4buCJwDHSPVeiCSxDlpKyfiiED9P87mPFxNntgvFW7UAX/wkYEkGSOSDXq5CYM nlHyReskbdm/Ky5tuM7JfWK9mmR/ux863AZobyvpsQ7K4v/K/SDl0YOYXeix1SHq3Mpz 0Bf7NpLKggNvBXVqlvBsM4I36W9y2+DrBs/OZ2/b8wjCcs6p/y4F2/zXs4jQJFLiku0m ueXq1flKOPw3CNZUiHWwS9azyYbLvw3lDJ8r2eA9gEC+tq5O9yuj0DlPe6F/l0VMupdt 4H7BB+JRDksC9ZUGv9nUrgOaBEYsD3ROYN1UTv+pyE1mPKk99k5Y8J0/T1dLAr1ayJvu pzzw== 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=McI1hu9zxVOEW0XZ+Mc7Cg0YGZAjNjcUIvXC4p8IHRWZz40NOKUhEYQQki7McxCY5T 5wuM8cTaHBjyV60qU5Z8SkAn5lo4A3DgSfKqZtbWiP6XYZVazCnZjLWc/U/EmslRyWhx E3GgPh9e1jmIxCJubxTRFJ0FcHNHQSdyoO7swOIy0JcRjVFGK68xPRyzMOD0TQ5FIuyJ mp87chQPlAYEOsovsfPhj3j2nQm0gWQMLkCCofgatsPbl9EnMg69cFHhMTrP0WjiK8Nr BTrk5aVeoLFrMQLskOdyINi5+73MSJaK3GuusnaGAadMPAuazpFhaNh4Ht1VWBr8Imeg ZNiQ== X-Gm-Message-State: APjAAAX2QZy0QduYmRwiLOEWfKdOJrauHvRLMrw/t1bWcqNyqSK20fc6 pH4e1acQim5oFyh28TdsziU= X-Received: by 2002:a63:1c64:: with SMTP id c36mr45435120pgm.302.1577395200912; Thu, 26 Dec 2019 13:20:00 -0800 (PST) Received: from localhost.localdomain ([2804:14d:72b1:8920:a2ce:f815:f14d:bfac]) by smtp.gmail.com with ESMTPSA id b22sm35114380pft.110.2019.12.26.13.19.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2019 13:20:00 -0800 (PST) From: "Daniel W. S. Almeida" X-Google-Original-From: Daniel W. S. Almeida To: corbet@lwn.net, mchehab+samsung@kernel.org Cc: "Daniel W. S. Almeida" , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [PATCH 1/5] Documentation: convert nfs.txt to ReST Date: Thu, 26 Dec 2019 18:19:43 -0300 Message-Id: X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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