Skip to contentSkip to conversation

autofs mountopints on NFS mounted filesystems

DISCUSSION Matthias Koenig 2 participants 4 messages Jun 13, 2008 – Jun 16, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

autofs will not create the autofs mountpoint path if the filesystem is not a locally mounted filesystem (e.g. a NFS mounted filesystem). contained_in_local_fs() returns false in this case. This might be intentional in most cases.

But how about if the root filesystem mounted via NFS? Do you see any problems adding an exceptional rule for this case?

Regards,
Matthias

maintainer
#1 lore raw
Quoted 11 lines · Matthias Koenig

Hi,

autofs will not create the autofs mountpoint path if the filesystem is not a locally mounted filesystem (e.g. a NFS mounted filesystem). contained_in_local_fs() returns false in this case. This might be intentional in most cases.

But how about if the root filesystem mounted via NFS? Do you see any problems adding an exceptional rule for this case?

Yeah, sounds sensible.

Ian

#2 lore raw
Quoted 9 lines · Ian Kent
Quoted 8 lines · Matthias Koenig

Hi,

autofs will not create the autofs mountpoint path if the filesystem is not a locally mounted filesystem (e.g. a NFS mounted filesystem). contained_in_local_fs() returns false in this case. This might be intentional in most cases.

Quoted 5 lines
Quoted 3 lines

But how about if the root filesystem mounted via NFS? Do you see any problems adding an exceptional rule for this case?

Yeah, sounds sensible.

Ok, how about the following patch?

Thanks,
Matthias

lib/mounts.c 2008-06-16 11:38:16.000000000 +0200 renamed from lib/mounts.c 2008-06-13 14:30:01.000000000 +0200 +4 -0
Index: autofs-5.0.3/lib/mounts.c
===================================================================
@@ -363,6 +363,10 @@ int contained_in_local_fs(const char *pa
                if (!strncmp(path, this->path, len)) {
                        if (len > 1 && pathlen > len && path[len] != '/')
                                continue;
+                       else if (len == 1 && this->path[0] == '/')
+                               /* alway return true on rootfs, we don't care
+                                * here if it is local */
+                               ret = 1;
                        else if (this->fs_name[0] == '/') {
                                if (strlen(this->fs_name) > 1) {
                                        if (this->fs_name[1] != '/')
maintainer
#3 lore raw
Quoted 11 lines · Matthias Koenig
Quoted 9 lines · Ian Kent
Quoted 8 lines · Matthias Koenig

Hi,

autofs will not create the autofs mountpoint path if the filesystem is not a locally mounted filesystem (e.g. a NFS mounted filesystem). contained_in_local_fs() returns false in this case. This might be intentional in most cases.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

But how about if the root filesystem mounted via NFS? Do you see any problems adding an exceptional rule for this case?

Yeah, sounds sensible.

Ok, how about the following patch?

Yeah, I'll commit it and post the patch to kernel.org as usual.

Quoted 19 lines

Thanks,
Matthias

Index: autofs-5.0.3/lib/mounts.c
===================================================================

lib/mounts.c 2008-06-16 11:38:16.000000000 +0200 renamed from lib/mounts.c 2008-06-13 14:30:01.000000000 +0200 +4 -0
@@ -363,6 +363,10 @@ int contained_in_local_fs(const char *pa
                if (!strncmp(path, this->path, len)) {
                        if (len > 1 && pathlen > len && path[len] != '/')
                                continue;
+                       else if (len == 1 && this->path[0] == '/')
+                               /* alway return true on rootfs, we don't care
+                                * here if it is local */
+                               ret = 1;
                        else if (this->fs_name[0] == '/') {
                                if (strlen(this->fs_name) > 1) {
                                        if (this->fs_name[1] != '/')