1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
Last-Update: 2014-03-07
Forwarded: yes
Bug-Debian: http://bugs.debian.org/678555
Bug-Ubuntu: http://pad.lv/1016673
From: Michael Tokarev <mjt@tls.msk.ru>
Subject: remove kernel and mount.nfs version check
autofs daemon checks for kernel and mount.nfs versions and uses
slightly different code if kernel is older than 2.6.22 or mount.nfs
does not use string options. Both cases are of very old, pre-squeeze,
versions.
But because automount spawns mount.nfs at startup, this interferes
with systemd and upstart daemon pid tracking mechanism (they track
pid of mount.nfs, not automount as a result). Fix this by removing
the check entirely.
Note that for current Debian and Ubuntu versions, no versioned Breaks
are necessary.
The patch is based on a similar patch by Dmitrijs Ledkovs.
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -56,9 +56,6 @@
unsigned int mp_mode = 0755;
-unsigned int nfs_mount_uses_string_options = 0;
-static struct nfs_mount_vers vers, check = {1, 1, 1};
-
/* autofs fifo name prefix */
#define FIFO_NAME_PREFIX "autofs.fifo"
const char *fifodir = AUTOFS_FIFO_DIR "/" FIFO_NAME_PREFIX;
@@ -1551,8 +1548,6 @@
if (status)
fatal(status);
- nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check);
-
master_mutex_lock();
/* Already doing a map read or shutdown or no mounts */
if (master->reading) {
@@ -2322,8 +2317,6 @@
exit(1);
}
- nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check);
-
flags = defaults_get_browse_mode() ? DAEMON_FLAGS_GHOST : 0;
flags |= DAEMON_FLAGS_CHECK_DAEMON;
--- a/include/mounts.h
+++ b/include/mounts.h
@@ -125,14 +125,7 @@
struct mnt_list *next;
};
-struct nfs_mount_vers {
- unsigned int major;
- unsigned int minor;
- unsigned int fix;
-};
unsigned int linux_version_code(void);
-int check_nfs_mount_version(struct nfs_mount_vers *, struct nfs_mount_vers *);
-extern unsigned int nfs_mount_uses_string_options;
int mount_fullpath(char *fullpath, size_t max_len,
const char *root, size_t root_len, const char *name);
--- a/modules/replicated.c
+++ b/modules/replicated.c
@@ -764,9 +764,8 @@
* But also allow the MOUNT_WAIT configuration parameter to override
* the probing.
*/
- if (nfs_mount_uses_string_options &&
- defaults_get_mount_wait() == -1 &&
- (kern_vers = linux_version_code()) > KERNEL_VERSION(2, 6, 22)) {
+ /* we assume kernel and mount.nfs are recent enough */
+ if (defaults_get_mount_wait() == -1) {
if (!this)
return 1;
} else {
--- a/lib/mounts.c
+++ b/lib/mounts.c
@@ -231,6 +231,7 @@
return kver.minor;
}
+#if 0
#ifdef HAVE_MOUNT_NFS
static int extract_version(char *start, struct nfs_mount_vers *vers)
{
@@ -371,6 +372,7 @@
return 0;
}
#endif
+#endif
int mount_fullpath(char *fullpath, size_t max_len,
const char *root, size_t root_len, const char *name)
|