Accepting request 143369 from Base:System

- New upstream release 1.2.7.  Adds FedFS support
  to mounted and replaces nfsdcld with
  nfsdcltrack.  This is used to manage client state
  on NFSv4 servers.
  Incorporates more local patches.
- Replace "/var/run" with "/run" in various scripts.
- nfsserver.init: Generate message that "bind=" is deprecated
  if it is used.

OBS-URL: https://build.opensuse.org/request/show/143369
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/nfs-utils?expand=0&rev=99
This commit is contained in:
Stephan Kulow 2012-11-28 15:19:06 +00:00 committed by Git OBS Bridge
commit f9f7761575
12 changed files with 51 additions and 258 deletions

View File

@ -1,34 +0,0 @@
commit 03bb227402ab023f4badb515022d49f82e01ff8d
Author: Neil Brown <neilb@suse.de>
Date: Thu May 17 16:40:40 2012 +1000
osd_login - ensure /sbin is created before installation.
If we use a more standard approach to describing the osd_login
script, the automake infrastructure will create /sbin before
attempting installation.
This is important for: make DESTDIR=/empty-dir install
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/utils/osd_login/Makefile.am b/utils/osd_login/Makefile.am
index adc493a..d17ffa7 100644
--- a/utils/osd_login/Makefile.am
+++ b/utils/osd_login/Makefile.am
@@ -1,12 +1,9 @@
## Process this file with automake to produce Makefile.in
-OSD_LOGIN_FILES= osd_login
+# These binaries go in /sbin (not /usr/sbin), and that cannot be
+# overriden at config time.
+sbindir = /sbin
-EXTRA_DIST= $(OSD_LOGIN_FILES)
-
-all-local: $(OSD_LOGIN_FILES)
-
-install-data-hook:
- $(INSTALL) --mode 755 osd_login $(DESTDIR)/sbin/osd_login
+sbin_SCRIPTS = osd_login
MAINTAINERCLEANFILES = Makefile.in

View File

@ -1,58 +0,0 @@
From 76908c3f14a12e865054ea5d6e4cad201c28839a Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 16 Jul 2012 08:43:28 -0400
Subject: [PATCH] mount.nfs: restore correct error status when umount fails
If nfs-utils is built without --enable-libmount-mount, then
an unmount that failed due to the filesystem being busy will
exit with '16' - EX_FILEIO.
Autofs apparently relies on this.
When built with --enable-libmount-mount, the same case will
exit with '32' - EX_FAIL. Normally this is reserved for
internal errors.
This patch restores the use of EX_FILEIO for errors from umount.
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/mount_libmount.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
--- nfs-utils-1.2.6.orig/utils/mount/mount_libmount.c
+++ nfs-utils-1.2.6/utils/mount/mount_libmount.c
@@ -173,6 +173,7 @@ static int umount_main(struct libmnt_con
{
int rc, c;
char *spec = NULL, *opts = NULL;
+ int ret = EX_FAIL;
static const struct option longopts[] = {
{ "force", 0, 0, 'f' },
@@ -243,7 +244,7 @@ static int umount_main(struct libmnt_con
/* strange, no entry in mtab or /proc not mounted */
nfs_umount23(spec, "tcp,v3");
}
-
+ ret = EX_FILEIO;
rc = mnt_context_do_umount(cxt); /* call umount(2) syscall */
mnt_context_finalize_mount(cxt); /* mtab update */
@@ -252,12 +253,10 @@ static int umount_main(struct libmnt_con
umount_error(rc, spec);
goto err;
}
-
- free(opts);
- return EX_SUCCESS;
+ ret = EX_SUCCESS;
err:
free(opts);
- return EX_FAIL;
+ return ret;
}
static int mount_main(struct libmnt_context *cxt, int argc, char **argv)

View File

@ -6,9 +6,9 @@
support/nfs/exports.c | 2 ++ support/nfs/exports.c | 2 ++
1 file changed, 2 insertions(+) 1 file changed, 2 insertions(+)
--- nfs-utils-1.2.3.orig/support/nfs/exports.c --- nfs-utils-1.2.7.orig/support/nfs/exports.c
+++ nfs-utils-1.2.3/support/nfs/exports.c +++ nfs-utils-1.2.7/support/nfs/exports.c
@@ -626,6 +626,8 @@ bad_option: @@ -628,6 +628,8 @@ bad_option:
} else if (strncmp(opt, "replicas=", 9) == 0) { } else if (strncmp(opt, "replicas=", 9) == 0) {
ep->e_fslocmethod = FSLOC_REPLICA; ep->e_fslocmethod = FSLOC_REPLICA;
ep->e_fslocdata = strdup(opt+9); ep->e_fslocdata = strdup(opt+9);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:70267288500408495085b7c54a667c4e8cfde5882f3193da095fc7dad2da0b83
size 755305

3
nfs-utils-1.2.7.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7ef8e0a8b22cd7ff33f3afd28e770d45643fae303468a180640c2967833fe75e
size 2902130

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Nov 28 00:08:55 UTC 2012 - nfbrown@suse.com
- New upstream release 1.2.7. Adds FedFD support
to mounted and replaces nfsdcld with
nfsdcltrack. This is used to manage client state
on NFSv4 servers.
Incorporates more local patches.
- Replace "/var/run" with "/run" in various scripts.
- nfsserver.init: Generate message that "bind=" is deprecated
if it is used.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Oct 17 23:55:27 UTC 2012 - nfbrown@suse.com Wed Oct 17 23:55:27 UTC 2012 - nfbrown@suse.com

View File

@ -31,16 +31,16 @@ BuildRequires: nfsidmap-devel >= 0.24
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: sqlite3-devel BuildRequires: sqlite3-devel
BuildRequires: tcpd-devel BuildRequires: tcpd-devel
Url: http://nfs.sourceforge.net Url: http://kernel.org/pub/linux/utils/nfs-utils/
Summary: Support Utilities for Kernel nfsd Summary: Support Utilities for Kernel nfsd
License: GPL-2.0+ License: GPL-2.0+
Group: Productivity/Networking/NFS Group: Productivity/Networking/NFS
Version: 1.2.6 Version: 1.2.7
Release: 0 Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %fillup_prereq %insserv_prereq PreReq: %fillup_prereq %insserv_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: http://downloads.sourceforge.net/project/nfs/nfs-utils/%{version}/nfs-utils-%{version}.tar.bz2 Source0: http://kernel.org/pub/linux/utils/nfs-utils/%{version}/nfs-utils-%{version}.tar.bz2
# Download does not work: # Download does not work:
# Source1: ftp://nfs.sourceforge.net/pub/nfs/nfs.doc.tar.bz2 # Source1: ftp://nfs.sourceforge.net/pub/nfs/nfs.doc.tar.bz2
Source1: nfs.doc.tar.bz2 Source1: nfs.doc.tar.bz2
@ -57,10 +57,6 @@ Source11: idmapd.conf
Source12: start-statd Source12: start-statd
Source13: nfs-utils.rpmlintrc Source13: nfs-utils.rpmlintrc
Patch0: nfs-utils-1.0.7-bind-syntax.patch Patch0: nfs-utils-1.0.7-bind-syntax.patch
Patch1: remove_pretty_sig.patch
Patch2: mkdir-sbin
Patch3: mount-exit-code.fix
Patch4: nfs4-no-umount
Suggests: python-base Suggests: python-base
%description %description
@ -139,10 +135,6 @@ Authors:
%prep %prep
%setup -q -n nfs-utils-%{version} -a 1 %setup -q -n nfs-utils-%{version} -a 1
%patch0 -p1 %patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
cp %{S:6} . cp %{S:6} .
%build %build
@ -153,7 +145,7 @@ CFLAGS="$RPM_OPT_FLAGS -fPIE -fno-strict-aliasing" LDFLAGS="-pie" ./configure \
--enable-nfsv4 \ --enable-nfsv4 \
--enable-gss \ --enable-gss \
--enable-ipv6 \ --enable-ipv6 \
--enable-nfsdcld \ --enable-nfsdcltrack \
--enable-mount \ --enable-mount \
--enable-libmount-mount \ --enable-libmount-mount \
--enable-mountconfig \ --enable-mountconfig \
@ -213,12 +205,12 @@ useradd -r -c 'NFS statd daemon' \
chown statd:nogroup /var/lib/nfs chown statd:nogroup /var/lib/nfs
chown -R statd /var/lib/nfs/{state,sm,sm.bak} >& /dev/null || : chown -R statd /var/lib/nfs/{state,sm,sm.bak} >& /dev/null || :
### migrate from /var/lock/subsys ### migrate from /var/lock/subsys
[ -d /var/run/nfs ] || mkdir /var/run/nfs [ -d /run/nfs ] || mkdir /run/nfs
if [ -f /var/lock/subsys/nfs-rpc.idmapd ]; then if [ -f /var/lock/subsys/nfs-rpc.idmapd ]; then
mv /var/lock/subsys/nfs-rpc.idmapd /var/run/nfs mv /var/lock/subsys/nfs-rpc.idmapd /run/nfs
fi fi
if [ -f /var/lock/subsys/nfsserver-rpc.idmapd ]; then if [ -f /var/lock/subsys/nfsserver-rpc.idmapd ]; then
mv /var/lock/subsys/nfsserver-rpc.idmapd /var/run/nfs mv /var/lock/subsys/nfsserver-rpc.idmapd /run/nfs
fi fi
### ###
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
@ -242,12 +234,12 @@ fi
%post -n nfs-kernel-server %post -n nfs-kernel-server
### migrate from /var/lock/subsys ### migrate from /var/lock/subsys
[ -d /var/run/nfs ] || mkdir /var/run/nfs [ -d /run/nfs ] || mkdir /run/nfs
if [ -f /var/lock/subsys/nfs-rpc.idmapd ]; then if [ -f /var/lock/subsys/nfs-rpc.idmapd ]; then
mv /var/lock/subsys/nfs-rpc.idmapd /var/run/nfs mv /var/lock/subsys/nfs-rpc.idmapd /run/nfs
fi fi
if [ -f /var/lock/subsys/nfsserver-rpc.idmapd ]; then if [ -f /var/lock/subsys/nfsserver-rpc.idmapd ]; then
mv /var/lock/subsys/nfsserver-rpc.idmapd /var/run/nfs mv /var/lock/subsys/nfsserver-rpc.idmapd /run/nfs
fi fi
### ###
%{fillup_and_insserv nfsserver} %{fillup_and_insserv nfsserver}
@ -322,7 +314,7 @@ fi
/usr/sbin/rpc.mountd /usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd /usr/sbin/rpc.nfsd
/usr/sbin/rpc.svcgssd /usr/sbin/rpc.svcgssd
/usr/sbin/nfsdcld /usr/sbin/nfsdcltrack
%{_mandir}/man5/exports.5.gz %{_mandir}/man5/exports.5.gz
%{_mandir}/man7/nfsd.7.gz %{_mandir}/man7/nfsd.7.gz
%{_mandir}/man8/exportfs.8.gz %{_mandir}/man8/exportfs.8.gz
@ -331,7 +323,7 @@ fi
%{_mandir}/man8/rpc.mountd.8.gz %{_mandir}/man8/rpc.mountd.8.gz
%{_mandir}/man8/rpc.nfsd.8.gz %{_mandir}/man8/rpc.nfsd.8.gz
%{_mandir}/man8/rpc.svcgssd.8.gz %{_mandir}/man8/rpc.svcgssd.8.gz
%{_mandir}/man8/nfsdcld.8.gz %{_mandir}/man8/nfsdcltrack.8.gz
/usr/share/omc/svcinfo.d/nfs-kernel-server.xml /usr/share/omc/svcinfo.d/nfs-kernel-server.xml
%config(noreplace) /var/lib/nfs/xtab %config(noreplace) /var/lib/nfs/xtab
%config(noreplace) /var/lib/nfs/etab %config(noreplace) /var/lib/nfs/etab

View File

@ -29,8 +29,8 @@ IDMAPD_BIN=/usr/sbin/rpc.idmapd
GSSD_BIN=/usr/sbin/rpc.gssd GSSD_BIN=/usr/sbin/rpc.gssd
STATD_BIN=/usr/sbin/rpc.statd STATD_BIN=/usr/sbin/rpc.statd
IDMAPD_CLIENT_STATE=/var/run/nfs/nfs-rpc.idmapd IDMAPD_CLIENT_STATE=/run/nfs/nfs-rpc.idmapd
IDMAPD_SERVER_STATE=/var/run/nfs/nfsserver-rpc.idmapd IDMAPD_SERVER_STATE=/run/nfs/nfsserver-rpc.idmapd
if [ -z "$RPC_PIPEFS_DIR" ]; then if [ -z "$RPC_PIPEFS_DIR" ]; then
RPC_PIPEFS_DIR=/var/lib/nfs/rpc_pipefs RPC_PIPEFS_DIR=/var/lib/nfs/rpc_pipefs
@ -219,7 +219,7 @@ case "$1-$nfs" in
rc_status -v rc_status -v
rc_exit rc_exit
} }
[ -d /var/run/nfs ] || mkdir /var/run/nfs [ -d /run/nfs ] || mkdir /run/nfs
echo $IDMAPD_BIN > $IDMAPD_CLIENT_STATE echo $IDMAPD_BIN > $IDMAPD_CLIENT_STATE
fi fi

View File

@ -1,49 +0,0 @@
From b0b342201140530c5b9e00408f12d22258df7c4e Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 6 Aug 2012 08:41:13 -0400
Subject: [PATCH] umount: use correct return value for is_vers4.
is_vers4 in mount_libmount.c is based on nfs_umount_is_vers4
in nfsumount.c, except the return values are reversed.
The result of this is:
- a MOUNT_UMNT call is not sent when an NFSv3 or NFSv2
filesystem is unmounted
- a MOUNT_UMNT call *is* sent when and 'nfs4' filesystem
is unmounted (but not when an 'nfs -o vers=4 filesystem
is unmounted, as that is checked elsewhere).
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/mount_libmount.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- nfs-utils-1.2.6.orig/utils/mount/mount_libmount.c
+++ nfs-utils-1.2.6/utils/mount/mount_libmount.c
@@ -140,14 +140,14 @@ static int try_mount(struct libmnt_conte
return ret;
}
-/* returns: error = -1, success = 0 , unknown = 1 */
+/* returns: error = -1, success = 1 , not vers4 == 0 */
static int is_vers4(struct libmnt_context *cxt)
{
struct libmnt_fs *fs = mnt_context_get_fs(cxt);
struct libmnt_table *tb = NULL;
const char *src = mnt_context_get_source(cxt),
*tgt = mnt_context_get_target(cxt);
- int rc = 1;
+ int rc = 0;
if (!src || !tgt)
return -1;
@@ -163,7 +163,7 @@ static int is_vers4(struct libmnt_contex
if (fs) {
const char *type = mnt_fs_get_fstype(fs);
if (type && strcmp(type, "nfs4") == 0)
- rc = 0;
+ rc = 1;
}
mnt_free_table(tb);
return rc;

View File

@ -55,9 +55,9 @@ SVCGSSD_BIN=/usr/sbin/rpc.svcgssd
IDMAPD_BIN=/usr/sbin/rpc.idmapd IDMAPD_BIN=/usr/sbin/rpc.idmapd
NFSD_BIN=/usr/sbin/rpc.nfsd NFSD_BIN=/usr/sbin/rpc.nfsd
IDMAPD_CLIENT_STATE=/var/run/nfs/nfs-rpc.idmapd IDMAPD_CLIENT_STATE=/run/nfs/nfs-rpc.idmapd
IDMAPD_SERVER_STATE=/var/run/nfs/nfsserver-rpc.idmapd IDMAPD_SERVER_STATE=/run/nfs/nfsserver-rpc.idmapd
NFSD_BIND_MOUNTS=/var/run/nfs/bind.mounts NFSD_BIND_MOUNTS=/run/nfs/bind.mounts
NEED_SVCGSSD=no NEED_SVCGSSD=no
NEED_IDMPAPD=no NEED_IDMPAPD=no
@ -94,14 +94,21 @@ check_for_nfsdfs() {
} }
nfs4_bind_mounts() { nfs4_bind_mounts() {
[ -d /var/run/nfs ] || mkdir /var/run/nfs [ -d /run/nfs ] || mkdir /run/nfs
warned=no
# In case of doubt, try "man sed" :-) # In case of doubt, try "man sed" :-)
cat /etc/exports | cat /etc/exports |
sed -n 'H;g;s/\\$//;h;t;s/^\n//;s/\n[[:space:]]*//g;s/#.*//;p;s/.*//;h' | sed -n 'H;g;s/\\$//;h;t;s/^\n//;s/\n[[:space:]]*//g;s/#.*//;p;s/.*//;h' |
sed 's/^\([^[:space:]]*\).*bind=\([^,)]*\).*/\1 \2/;t;d' | sed 's/^\([^[:space:]]*\).*bind=\([^,)]*\).*/\1 \2/;t;d' |
sort | sort |
while read export dir; do while read export dir; do
if [ $warned = no ] ; then
echo
echo "NFS: The usage of 'bind=' in /etc/exports is deprecated."
echo "NFS: Is it no longer needed and may cease to work."
echo "NFS: Please remove these settings."
warned=yes
fi
test -d "$export" || mkdir -p "$export" test -d "$export" || mkdir -p "$export"
mount -o bind "$dir" "$export" mount -o bind "$dir" "$export"
echo "$dir" "$export" echo "$dir" "$export"
@ -200,7 +207,7 @@ case "$1" in
rc_status -v rc_status -v
rc_exit rc_exit
} }
[ -d /var/run/nfs ] || mkdir /var/run/nfs [ -d /run/nfs ] || mkdir /run/nfs
echo $IDMAPD_BIN > $IDMAPD_SERVER_STATE echo $IDMAPD_BIN > $IDMAPD_SERVER_STATE
fi fi
# exportfs # exportfs
@ -252,7 +259,7 @@ case "$1" in
killproc -n -KILL lockd killproc -n -KILL lockd
fi fi
# make sure sm-notify is run on restart, as we have dropped some locks # make sure sm-notify is run on restart, as we have dropped some locks
rm -f /var/run/sm-notify.pid rm -f /run/sm-notify.pid
# #
# rpc.mountd # rpc.mountd
echo -n " mountd" echo -n " mountd"
@ -318,7 +325,7 @@ case "$1" in
# Status has a slightly different for the status command: # Status has a slightly different for the status command:
# 0 - service running # 0 - service running
# 1 - service dead, but /var/run/ pid file exists # 1 - service dead, but /run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists # 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running # 3 - service not running

View File

@ -1,79 +0,0 @@
From: Jim Rees <rees@umich.edu>
Date: Tue, 27 Mar 2012 10:18:39 -0400
Subject: [PATCH 1/2] remove pretty_sig()
This really only works against EMC servers. There is at least one server
that returns unprintable signatures, which fill the log with garbage (the
spec does not mandate printable signatures). It could be made more generic,
for example by checking each byte for isprint(). But the signatures are
really only of interest to developers, not admins, so it seems better to
just remove it.
Signed-off-by: Jim Rees <rees@umich.edu>
Acked-by: NeilBrown <neilb@suse.de>
---
utils/blkmapd/device-process.c | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/utils/blkmapd/device-process.c b/utils/blkmapd/device-process.c
index 652a7a8..5fe3dff 100644
--- a/utils/blkmapd/device-process.c
+++ b/utils/blkmapd/device-process.c
@@ -49,28 +49,6 @@
#include "device-discovery.h"
-static char *pretty_sig(char *sig, uint32_t siglen)
-{
- static char rs[100];
- uint64_t sigval;
- unsigned int i;
-
- if (siglen <= sizeof(sigval)) {
- sigval = 0;
- for (i = 0; i < siglen; i++)
- sigval |= ((unsigned char *)sig)[i] << (i * 8);
- sprintf(rs, "0x%0llx", (unsigned long long) sigval);
- } else {
- if (siglen > sizeof rs - 4) {
- siglen = sizeof rs - 4;
- sprintf(&rs[siglen], "...");
- } else
- rs[siglen] = '\0';
- memcpy(rs, sig, siglen);
- }
- return rs;
-}
-
uint32_t *blk_overflow(uint32_t * p, uint32_t * end, size_t nbytes)
{
uint32_t *q = p + ((nbytes + 3) >> 2);
@@ -109,9 +87,6 @@ static int decode_blk_signature(uint32_t **pp, uint32_t * end,
* for mapping, then thrown away.
*/
comp->bs_string = (char *)p;
- BL_LOG_INFO("%s: si_comps[%d]: bs_length %d, bs_string %s\n",
- __func__, i, siglen,
- pretty_sig(comp->bs_string, siglen));
p += ((siglen + 3) >> 2);
}
*pp = p;
@@ -152,10 +127,6 @@ read_cmp_blk_sig(struct bl_disk *disk, int fd, struct bl_sig_comp *comp)
}
ret = memcmp(sig, comp->bs_string, siglen);
- if (!ret)
- BL_LOG_INFO("%s: %s sig %s at %lld\n", __func__, dev_name,
- pretty_sig(sig, siglen),
- (long long)comp->bs_offset);
out:
if (sig)
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

View File

@ -1,7 +1,7 @@
#!/bin/sh -p #!/bin/sh -p
# nfsmount calls this script when mounting a filesystem with locking # nfsmount calls this script when mounting a filesystem with locking
# enabled, but when statd does not seem to be running (based on # enabled, but when statd does not seem to be running (based on
# /var/run/rpc.statd.pid). # /run/rpc.statd.pid).
# It should run run statd with whatever flags are apropriate for this # It should run run statd with whatever flags are apropriate for this
# site. # site.
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin