Commit 61f00590 authored by Jonathan Corbet's avatar Jonathan Corbet
Browse files

Merge branch 'nfs' into docs-next

Daniel W. S. Almeida writes:

  This series converts a few docs in Documentation/filesystems/nfs to RST.
  The docs were also moved into admin-guide because they contain
  information that might be useful for system administrators

  Most changes are related to aesthetics and presentation, i.e. the content
  itself remains mostly untouched. The use of markup was limited in order
  not to negatively impact the plain-text reading experience.
parents a1986433 6996e8ca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
===================
NFS Fault Injection
===================

Fault Injection
===============
Fault injection is a method for forcing errors that may not normally occur, or
may be difficult to reproduce.  Forcing these errors in a controlled environment
can help the developer find and fix bugs before their code is shipped in a
+15 −0
Original line number Diff line number Diff line
=============
NFS
=============

.. toctree::
    :maxdepth: 1

    nfs-client
    nfsroot
    nfs-rdma
    nfsd-admin-interfaces
    nfs-idmapper
    pnfs-block-server
    pnfs-scsi-server
    fault_injection
+45 −40
Original line number Diff line number Diff line
==========
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
@@ -94,7 +98,8 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual
       script, and <ttl> is the 'time to live' of this cache entry (in
       units of seconds).

       Note: If <ip address> is invalid, say the string "0", then a negative
       .. note::
            If <ip address> 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.

@@ -103,6 +108,7 @@ Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual

A basic sample /sbin/nfs_cache_getent
=====================================
.. code-block:: sh

    #!/bin/bash
    #
@@ -133,4 +139,3 @@ case "${cachename}" in
            ;;
    esac
    echo "${result} ${name} ${ttl}" >${cache_path}
+17 −14
Original line number Diff line number Diff line
=============
NFS ID Mapper
=============

=========
ID Mapper
=========
Id mapper is used by NFS to translate user and group ids into names, and to
translate user and group names into ids.  Part of this translation involves
performing an upcall to userspace to request the information.  There are two
@@ -20,22 +20,24 @@ legacy rpc.idmap daemon for the id mapping. This result will be stored
in a custom NFS idmap cache.


===========
Configuring
===========

The file /etc/request-key.conf will need to be modified so /sbin/request-key can
direct the upcall.  The following line should be added:

#OP	TYPE	DESCRIPTION	CALLOUT INFO	PROGRAM ARG1 ARG2 ARG3 ...
#======	=======	===============	===============	===============================
create	id_resolver	*	*		/usr/sbin/nfs.idmap %k %d 600
``#OP	TYPE	DESCRIPTION	CALLOUT INFO	PROGRAM ARG1 ARG2 ARG3 ...``
``#======	=======	===============	===============	===============================``
``create	id_resolver	*	*		/usr/sbin/nfs.idmap %k %d 600``


This will direct all id_resolver requests to the program /usr/sbin/nfs.idmap.
The last parameter, 600, defines how many seconds into the future the key will
expire.  This parameter is optional for /usr/sbin/nfs.idmap.  When the timeout
is not specified, nfs.idmap will default to 600 seconds.

id mapper uses for key descriptions:
id mapper uses for key descriptions::

	  uid:  Find the UID for the given user
	  gid:  Find the GID for the given group
	 user:  Find the user  name for the given UID
@@ -45,23 +47,24 @@ You can handle any of these individually, rather than using the generic upcall
program.  If you would like to use your own program for a uid lookup then you
would edit your request-key.conf so it look similar to this:

#OP	TYPE	DESCRIPTION	CALLOUT INFO	PROGRAM ARG1 ARG2 ARG3 ...
#======	=======	===============	===============	===============================
create	id_resolver	uid:*	*		/some/other/program %k %d 600
create	id_resolver	*	*		/usr/sbin/nfs.idmap %k %d 600
``#OP	TYPE	DESCRIPTION	CALLOUT INFO	PROGRAM ARG1 ARG2 ARG3 ...``
``#======	=======	===============	===============	===============================``
``create	id_resolver	uid:*	*		/some/other/program %k %d 600``
``create	id_resolver	*	*		/usr/sbin/nfs.idmap %k %d 600``


Notice that the new line was added above the line for the generic program.
request-key will find the first matching line and corresponding program.  In
this case, /some/other/program will handle all uid lookups and
/usr/sbin/nfs.idmap will handle gid, user, and group lookups.

See <file:Documentation/security/keys/request-key.rst> for more information
See Documentation/security/keys/request-key.rst for more information
about the request-key function.


=========
nfs.idmap
=========

nfs.idmap is designed to be called by request-key, and should not be run "by
hand".  This program takes two arguments, a serialized key and a key
description.  The serialized key is first converted into a key_serial_t, and
Loading