mount.nfs: Don't silently ignore invalid protocol versions.

Signed-off-by: Steve Dickson <steved@redhat.com>
nfsd: fix minorversion-choosing interface

From: "J. Bruce Fields" <bfields@redhat.com>

By unconditionally adding ?4.2 to the version string written to the
kernel we make nfs-utils incompatible with pre-4.2-supporting kernels.

Ditto for 4.1.  This problem was introduced by
12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server
support with the -V option", which also change nfsd to unconditionally
pass ?4.2.

Instead, just don't mention 4.1 or 4.2 unless the commandline has
specifically requested that one or the other be turned on or off.

Tested-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Reported-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
exportfs.c: escape path for function test_export

Verbatim patch proposal from J. Bruce Fields except calling
snprintf instead of sprintf.

Tested and appears to work with path names that have a space.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
exportfs.c: Remove trailing whitespace

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
exportfs.c: Escape path for '-s' option

When outputing the paths and the user has specified the
option -s, escape the path.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
mountd: optimize libblkid usage

 * use get_uuid_blkdev() only first time for the path (it means
   that uuid_by_path() is called with type==0)

 * don't use libblkid for btrfs, network or pseudo filesystems

Note that the patch defines the fs type ID rather than include
<linux/magic.h> as this file seems incomplete and libc specific).

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>