From a0637e496623cd7cadbd019bd77aba09dbd7340a83a8da48a8c3a0e235cfb1ff Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 6 May 2008 21:34:46 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/nfs-utils?expand=0&rev=22 --- nfs-utils-1.1.2-start-statd.patch | 99 +++++++++++++++++++++++++++++++ nfs-utils.changes | 7 +++ nfs-utils.spec | 8 ++- 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 nfs-utils-1.1.2-start-statd.patch diff --git a/nfs-utils-1.1.2-start-statd.patch b/nfs-utils-1.1.2-start-statd.patch new file mode 100644 index 0000000..d385269 --- /dev/null +++ b/nfs-utils-1.1.2-start-statd.patch @@ -0,0 +1,99 @@ +From a22d681bb98b212f8f67986222a9577180479551 Mon Sep 17 00:00:00 2001 +From: Neil Brown +Date: Tue, 6 May 2008 14:35:47 +1000 +Subject: [PATCH] Make sure statd gets started when 'string options' are in use. + +The code for checking and starting statd was only in the binary-options +branch of the code. +This moves it into common code. +--- + utils/mount/mount.c | 22 ++++++++++++++++++++-- + utils/mount/nfsmount.c | 11 ----------- + 2 files changed, 20 insertions(+), 13 deletions(-) + +diff --git a/utils/mount/mount.c b/utils/mount/mount.c +index 5076468..0036caa 100644 +--- a/utils/mount/mount.c ++++ b/utils/mount/mount.c +@@ -334,7 +334,8 @@ static void parse_opt(const char *opt, int *mask, char *extra_opts, int len) + * standard options (indicated by MS_ bits), and output parameter + * "@extra_opts" gets all the filesystem-specific options. + */ +-static void parse_opts(const char *options, int *flags, char **extra_opts) ++static void parse_opts(const char *options, int *flags, char **extra_opts, ++ int *lock) + { + if (options != NULL) { + char *opts = xstrdup(options); +@@ -358,6 +359,10 @@ static void parse_opts(const char *options, int *flags, char **extra_opts) + /* end of option item or last item */ + if (*p == '\0' || *(p + 1) == '\0') { + parse_opt(opt, flags, *extra_opts, len); ++ if (strcmp(opt, "lock") == 0) ++ *lock = 1; ++ if (strcmp(opt, "nolock") == 0) ++ *lock = 0; + opt = NULL; + } + } +@@ -421,6 +426,7 @@ int main(int argc, char *argv[]) + char *spec, *mount_point, *fs_type = "nfs"; + char *extra_opts = NULL, *mount_opts = NULL; + uid_t uid = getuid(); ++ int lock = 1; + + progname = basename(argv[0]); + +@@ -531,7 +537,7 @@ int main(int argc, char *argv[]) + goto out; + } + +- parse_opts(mount_opts, &flags, &extra_opts); ++ parse_opts(mount_opts, &flags, &extra_opts, &lock); + + if (uid != 0) { + if (!(flags & (MS_USERS|MS_USER))) { +@@ -546,6 +552,18 @@ int main(int argc, char *argv[]) + goto out; + } + ++ if (!fake && lock) { ++ if (!start_statd()) { ++ nfs_error(_("%s: rpc.statd is not running but is " ++ "required for remote locking.\n" ++ " Either use '-o nolock' to keep " ++ "locks local, or start statd."), ++ progname); ++ mnt_err = EX_FAIL; ++ goto out; ++ } ++ } ++ + mnt_err = try_mount(spec, mount_point, flags, fs_type, &extra_opts, + mount_opts, fake, nomtab, FOREGROUND); + if (mnt_err == EX_BG) { +diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c +index 6c0c365..e6ed019 100644 +--- a/utils/mount/nfsmount.c ++++ b/utils/mount/nfsmount.c +@@ -851,17 +851,6 @@ noauth_flavors: + + *extra_opts = xstrdup(new_opts); + +- if (!fake && !(data.flags & NFS_MOUNT_NONLM)) { +- if (!start_statd()) { +- nfs_error(_("%s: rpc.statd is not running but is " +- "required for remote locking.\n" +- " Either use '-o nolock' to keep " +- "locks local, or start statd."), +- progname); +- goto fail; +- } +- } +- + if (!fake) { + if (mount(spec, node, "nfs", + flags & ~(MS_USER|MS_USERS), &data)) { +-- +1.5.5.1 + diff --git a/nfs-utils.changes b/nfs-utils.changes index a41eec0..86535eb 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue May 6 08:00:18 CEST 2008 - nfbrown@suse.de + +- nfs-utils-1.1.2-start-statd.patch - statd needs to be started + when using 'string' options to kernel was well as when using + binary options. + ------------------------------------------------------------------- Fri May 2 05:22:19 CEST 2008 - nfbrown@suse.de diff --git a/nfs-utils.spec b/nfs-utils.spec index 7684f66..8b52bd5 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -16,7 +16,7 @@ BuildRequires: e2fsprogs-devel gcc-c++ krb5-devel libevent libgssglue-devel lib Url: http://nfs.sourceforge.net Summary: Support Utilities for Kernel nfsd Version: 1.1.2 -Release: 5 +Release: 6 Group: Productivity/Networking/NFS License: GPL v2 or later BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -34,6 +34,7 @@ Source7: fw-client Source8: fw-server Patch0: nfs-utils-largefiles.patch Patch1: nfs-utils-1.0.7-bind-syntax.patch +Patch2: nfs-utils-1.1.2-start-statd.patch %description This package contains the NFS utilities. You can tune the number of @@ -109,6 +110,7 @@ Authors: %setup -q -n nfs-utils-%{version} -a 1 %patch0 -p1 %patch1 -p1 +%patch2 -p1 cp %{S:6} . %build @@ -250,6 +252,10 @@ rm -rf $RPM_BUILD_ROOT %doc nfs/*.html nfs/*.ps linux-nfs/* README.NFSv4 %changelog +* Tue May 06 2008 nfbrown@suse.de +- nfs-utils-1.1.2-start-statd.patch - statd needs to be started + when using 'string' options to kernel was well as when using + binary options. * Fri May 02 2008 nfbrown@suse.de - Added SM_NOTIFY_OPTIONS sysconfig - (bnc #379806) - Removed needless rc_status/rc_exit games in nfsserver.init (bnc #380156)