From cb040c180ba1b724bf6bda21a76bffe29a5947f08a1856405ff0824210dcbd5c Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 27 Sep 2012 02:12:06 +0000 Subject: [PATCH] - nfs4-no-umount: does send MOUNT_UMNT rpcs when unmounting an 'nfs4' filesystem. They are only required for nfs2,3. (bnc#772534) OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=77 --- nfs-utils.changes | 7 +++++++ nfs-utils.spec | 2 ++ nfs4-no-umount | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 nfs4-no-umount diff --git a/nfs-utils.changes b/nfs-utils.changes index c773b96..9986cce 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Sep 27 02:10:53 UTC 2012 - nfbrown@suse.com + +- nfs4-no-umount: does send MOUNT_UMNT rpcs + when unmounting an 'nfs4' filesystem. They + are only required for nfs2,3. (bnc#772534) + ------------------------------------------------------------------- Thu Jul 19 06:26:10 UTC 2012 - nfbrown@suse.com diff --git a/nfs-utils.spec b/nfs-utils.spec index 0b323ae..282d103 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -60,6 +60,7 @@ 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 %description @@ -139,6 +140,7 @@ Authors: %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 cp %{S:6} . %build diff --git a/nfs4-no-umount b/nfs4-no-umount new file mode 100644 index 0000000..3084136 --- /dev/null +++ b/nfs4-no-umount @@ -0,0 +1,49 @@ +From b0b342201140530c5b9e00408f12d22258df7c4e Mon Sep 17 00:00:00 2001 +From: NeilBrown +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 +Signed-off-by: Steve Dickson + +--- + 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;