Skip to contentSkip to conversation

backfstype patch.

PATCH Hans Deragon 4 participants 10 messages Jun 29, 2004 – Jun 30, 2004 Kernel automounter

lore
Share & tools
lore
#0 lore raw

Greetings.

Attached, my patch for supporting backfstype. If the OS is Linux and cachefs
is detected, this fs is ignored and no attempt is made to mount a cachefs kernel module (none exist). This way we avoid useless error messages in syslog.

If mounting the fstype fails or is cachefs, backfstype is then tried.

It works fine under RHL 9. Only one file was changed: parse_sun.c. The
changes were made from the 4.1.3 branch. Changes are very localized and I believe they are safe (though code inspection is always desired).

Please confirm if my patch has been accepted.

Best regards,
Hans Deragon
--
Consultant en informatique/Software Consultant

Deragon Informatique inc.     Open source:
http://www.deragon.biz        http://facil.qc.ca (Promotion du libre)
mailto://[email protected]     http://autopoweroff.sourceforge.net (Logiciel)
modules/parse_sun.c +74 -16
diff -Nur autofs-4.1.3.org/modules/parse_sun.c autofs-4.1.3/modules/parse_sun.c
@@ -22,7 +22,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
-#include <syslog.h>
 #include <string.h>
 #include <syslog.h>
 #include <ctype.h>
@@ -516,17 +515,20 @@
 static int sun_mount(const char *root, const char *name, int namelen,
 		     const char *loc, int loclen, const char *options)
 {
-	char *fstype = "nfs";	/* Default filesystem type */
+	char *fstype     = "nfs"; /* Default filesystem type */
+	char *backfstype = "nfs";	/* Default filesystem type */
+	char *curfstype = NULL;
 	int nonstrict = 1;
-	int rv;
+	int rv = -1;
 	char *mountpoint;
 	char *what;
+	char *noptions = NULL;
 
-	if (*options == '\0')
+	if (*options == '\0') {
 		options = NULL;
+  }
 
 	if (options) {
-		char *noptions;
 		const char *comma;
 		char *np;
 		int len = strlen(options) + 1;
@@ -551,6 +553,15 @@
 				fstype = alloca(typelen + 1);
 				memcpy(fstype, cp + 7, typelen);
 				fstype[typelen] = '\0';
+			} else if (strncmp("backfstype=", cp, 11) == 0) {
+				int typelen = comma - (cp + 11);
+				backfstype = alloca(typelen + 1);
+				memcpy(backfstype, cp + 11, typelen);
+				backfstype[typelen] = '\0';
+#if 0
+			} else if (strncmp("cachedir=", cp, 9) == 0) {
+        /* Ignoring cachedir, since cachefs is not supported. */
+#endif
 			} else if (strncmp("strict", cp, 6) == 0) {
 				nonstrict = 0;
 			} else if (strncmp("nonstrict", cp, 9) == 0) {
@@ -589,17 +600,64 @@
 		what[loclen] = '\0';
 	}
 
-	debug(MODPREFIX
-	    "mounting root %s, mountpoint %s, what %s, fstype %s, options %s\n",
-	    root, mountpoint, what, fstype, options);
-
-	if (!strcmp(fstype, "nfs")) {
-		rv = mount_nfs->mount_mount(root, mountpoint, strlen(mountpoint),
-					    what, fstype, options, mount_nfs->context);
-	} else {
-		/* Generic mount routine */
-		rv = do_mount(root, mountpoint, strlen(mountpoint), what, fstype,
-			      options);
+	int index;
+	char *curoptions = NULL;
+	char *start, *end;
+	for (index=0; index<2; index++) {
+		if (index==0)
+			curfstype=fstype;
+		else
+			curfstype=backfstype;
+
+#ifdef __linux__
+		if (!strcmp(curfstype, "cachefs")) {
+			/* cachefs not supported for Linux.  We do not even try because when
+			   we try, mount will complain about the module being absent.  This is
+			   not desired because if backfstype parameter is provided and works,
+			   we sure do not want any error messages reported to syslog. */
+			debug("cachefs not implemented under Linux and thus ignored.");
+			continue;
+		}
+#endif
+
+		if (!strcmp(curfstype, "nfs")) {
+			/* Removing cachedir parameter which is not understood by nfs. */
+			start=strstr(noptions, ",cachedir=");
+			if (start != NULL) {
+				/* cachedir parameter found.  Now removing it. */
+				int noptions_len=strlen(noptions);
+				end=strstr(start+1, ",");
+				curoptions = alloca(noptions_len-(end-start)+1);
+				strncpy(curoptions, noptions, start-noptions);
+				strncpy(curoptions+(start-noptions), end, noptions_len-(end-noptions));
+			} else {
+				/* No cachedir parameter found.  Using noptions as is. */
+				curoptions=noptions;
+			}
+		}
+		else
+			curoptions=noptions;
+
+		/* Updating options for calling function. */
+		options=curoptions;
+
+		debug(MODPREFIX
+				"mounting root %s, mountpoint %s, what %s, fstype %s, options %s\n",
+				root, mountpoint, what, curfstype, curoptions);
+
+		if (!strcmp(curfstype, "nfs")) {
+			rv = mount_nfs->mount_mount(root, mountpoint, strlen(mountpoint),
+			                what, curfstype, curoptions, mount_nfs->context);
+		} else {
+			/* Generic mount routine */
+			rv = do_mount(root, mountpoint, strlen(mountpoint), what, curfstype,
+			              curoptions);
+		}
+
+		if(!rv)
+		{
+			break;
+		}
 	}
 
 	if (nonstrict && rv) {

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

#1 lore raw

==> Regarding [autofs] backfstype patch.; Hans Deragon <[email protected]> adds:

hans> Greetings. Attached, my patch for supporting backfstype. If the OS hans> is Linux and cachefs is detected, this fs is ignored and no attempt hans> is made to mount a cachefs kernel module (none exist). This way we hans> avoid useless error messages in syslog.

First off, thanks for taking the initiative!

Now, to business. Ian meant to say that you _don't_ need to do #ifdef __linux__, as this is the Linux automounter. It won't work on any other OS.

I'm not sure I like the special casing for cachefs, but that's ultimately Ian's call. I just attempted a mount -t cachefs on my machine, and got no messages in the logs. I wonder what's trying the modprobe.

I've taken a cursory look at your patch, and inlined some initial comments. I'll try to take a closer look at it some time this week.

Thanks!

Jeff

Quoted 12 lines

diff -Nur autofs-4.1.3.org/modules/parse_sun.c autofs-4.1.3/modules/parse_sun.c

modules/parse_sun.c +0 -1
@@ -22,7 +22,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
-#include <syslog.h>
 #include <string.h>
 #include <syslog.h>
 #include <ctype.h>

modules/parse_sun.c line 518

Quoted 5 lines
modules/parse_sun.c +1 -1
@@ -516,17 +515,20 @@
 static int sun_mount(const char *root, const char *name, int namelen,
 		     const char *loc, int loclen, const char *options)
 {
-	char *fstype = "nfs";	/* Default filesystem type */
+	char *fstype     = "nfs"; /* Default filesystem type */

Bad form to change spacing.

[snip]

modules/parse_sun.c line 564

Quoted 13 lines
modules/parse_sun.c +9 -0
@@ -551,6 +553,15 @@
 				fstype = alloca(typelen + 1);
 				memcpy(fstype, cp + 7, typelen);
 				fstype[typelen] = '\0';
+			} else if (strncmp("backfstype=", cp, 11) == 0) {
+				int typelen = comma - (cp + 11);
+				backfstype = alloca(typelen + 1);
+				memcpy(backfstype, cp + 11, typelen);
+				backfstype[typelen] = '\0';
+#if 0
+			} else if (strncmp("cachedir=", cp, 9) == 0) {
+        /* Ignoring cachedir, since cachefs is not supported. */
+#endif

Ick.

[snip]

modules/parse_sun.c line 621

Quoted 10 lines
modules/parse_sun.c +10 -0
+#ifdef __linux__
+		if (!strcmp(curfstype, "cachefs")) {
+			/* cachefs not supported for Linux.  We do not even try because when
+			   we try, mount will complain about the module being absent.  This is
+			   not desired because if backfstype parameter is provided and works,
+			   we sure do not want any error messages reported to syslog. */
+			debug("cachefs not implemented under Linux and thus ignored.");
+			continue;
+		}
+#endif

Don't need the ifdef. Also, try to keep w/in 80 columns, please.

modules/parse_sun.c line 625

Quoted 4 lines
modules/parse_sun.c +4 -0
+
+		if (!strcmp(curfstype, "nfs")) {
+			/* Removing cachedir parameter which is not understood by nfs. */
+			start=strstr(noptions, ",cachedir=");

You don't really need to do this. We use the sloppy (-s) option to mount, which just ignore unrecognized options.

[snip]

modules/parse_sun.c line 660

Quoted 4 lines
modules/parse_sun.c +4 -0
+		if(!rv)
+		{
+			break;
+		}

Keep to coding style: { on same line as if.

#4 lore raw
In reply to Hans Deragon

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · Hans Deragon

Greetings.

Attached, my patch for supporting backfstype. If the OS is Linux and
cachefs is detected, this fs is ignored and no attempt is made to mount a cachefs kernel module (none exist). This way we avoid useless error messages in syslog.

Quoted 8 lines

If mounting the fstype fails or is cachefs, backfstype is then tried.

It works fine under RHL 9. Only one file was changed: parse_sun.c.
The changes were made from the 4.1.3 branch. Changes are very localized and I believe they are safe (though code inspection is always desired).

Please confirm if my patch has been accepted.

Why do this in the parser when it can easily be done in a mount module?

- --
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice
http://www.sun.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The opinions expressed in this email are held by me, and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA4sC5dQs4kOxk3/MRAmqMAJ4ozb8H/WCSLofDJ1qSC+PrJZsoFwCeIL2R ugeytb6z6DP53zz2AC2bJm0=
=pEWR
-----END PGP SIGNATURE-----

#5 lore raw

==> Regarding Re: [autofs] backfstype patch.; Mike Waychison <[email protected]> adds:

Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE----- Hash> SHA1

Quoted 8 lines · Michael.Waychison> Hans Deragon wrote:
Quoted 8 lines

Greetings.

Attached, my patch for supporting backfstype. If the OS is Linux and cachefs is detected, this fs is ignored and no attempt is made to mount a cachefs kernel module (none exist). This way we avoid useless error messages in syslog.

Quoted 8 lines
Quoted 8 lines

If mounting the fstype fails or is cachefs, backfstype is then tried.

It works fine under RHL 9. Only one file was changed: parse_sun.c. The changes were made from the 4.1.3 branch. Changes are very localized and I believe they are safe (though code inspection is always desired).

Please confirm if my patch has been accepted.

Michael.Waychison> Why do this in the parser when it can easily be done in Michael.Waychison> a mount module?

Care to expound a bit? I'm not sure what people use backfstype for, but if it is generic, then you wouldn't want to handle every case in every mount module. But I think I'm missing your point.

It makes some sense to me to handle this above the mount module, simply because you could call into two different modules.

So, care to set me straight? ;)

-Jeff

#2 lore raw
In reply to Jeff Moyer
Quoted 11 lines · Jeff Moyer

modules/parse_sun.c line 621

Quoted 9 lines
modules/parse_sun.c +9 -0
+		if (!strcmp(curfstype, "cachefs")) {
+			/* cachefs not supported for Linux.  We do not even try because when
+			   we try, mount will complain about the module being absent.  This is
+			   not desired because if backfstype parameter is provided and works,
+			   we sure do not want any error messages reported to syslog. */
+			debug("cachefs not implemented under Linux and thus ignored.");
+			continue;
+		}
+#endif

Don't need the ifdef. Also, try to keep w/in 80 columns, please.

We know it's hard to keep within 80 cols. I constantly try to rearrange code to try and achieve this.

Quoted 6 lines

modules/parse_sun.c line 660

Quoted 4 lines
modules/parse_sun.c +4 -0
+		if(!rv)
+		{
+			break;
+		}

Keep to coding style: { on same line as if.

The document in the kernel source is an excellent guide to what to try to achieve coding standards.

<kernel source dir>/Documentation/CodingStyle

Ian

#6 lore raw
In reply to Jeff Moyer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 1 line · Jeff Moyer

==> Regarding Re: [autofs] backfstype patch.; Mike Waychison

<[email protected]> adds:

Quoted 20 lines

Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE----- Hash> SHA1

Quoted 14 lines · Michael.Waychison> Hans Deragon wrote:
Quoted 14 lines

Greetings.

Attached, my patch for supporting backfstype. If the OS is Linux and cachefs is detected, this fs is ignored and no attempt is made to mount a cachefs kernel module (none exist). This way we avoid useless error messages in syslog.

If mounting the fstype fails or is cachefs, backfstype is then tried.

It works fine under RHL 9. Only one file was changed: parse_sun.c. The changes were made from the 4.1.3 branch. Changes are very localized and I believe they are safe (though code inspection is always desired).

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Please confirm if my patch has been accepted.

Michael.Waychison> Why do this in the parser when it can easily be done in Michael.Waychison> a mount module?

Care to expound a bit? I'm not sure what people use backfstype for,

but if

Quoted 9 lines

it is generic, then you wouldn't want to handle every case in every mount module. But I think I'm missing your point.

It makes some sense to me to handle this above the mount module, simply because you could call into two different modules.

So, care to set me straight? ;)

-Jeff

I'm CC'ing David as he may have a better view of what the cachefs status is.

Backfstype is a fstype=cachefs specific mount option. Specifically:

- add cachefs to the not_generic array in daemon/mount.c
- create a new mount module, modules/mount_cachefs.c. This module
would check for cachefs support available and use it if available. Otherwise it would rewrite the fstype with the backfstype mount option and call do_mount again.

- --
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice
http://www.sun.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The opinions expressed in this email are held by me, and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA4sxCdQs4kOxk3/MRAu57AKCApSStIq7S4lvKUTxHhLmoM8hjNwCcDELp PsbhD31X2ZI7p7TZRBzDA8I=
=SsXB
-----END PGP SIGNATURE-----

#7 lore raw

==> Regarding Re: [autofs] backfstype patch.; Mike Waychison <[email protected]> adds:

Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE----- Hash> SHA1

Quoted 3 lines · Michael.Waychison> Jeff Moyer wrote:
Quoted 3 lines

==> Regarding Re: [autofs] backfstype patch.; Mike Waychison [email protected]> adds:

Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE----- Hash> SHA1

Quoted 1 line
Quoted 1 line
Quoted 11 lines · Michael.Waychison> Hans Deragon wrote:
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Greetings.

Attached, my patch for supporting backfstype. If the OS is Linux and cachefs is detected, this fs is ignored and no attempt is made to mount a cachefs kernel module (none exist). This way we avoid useless error messages in syslog.

If mounting the fstype fails or is cachefs, backfstype is then tried.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines

It works fine under RHL 9. Only one file was changed: parse_sun.c. The changes were made from the 4.1.3 branch. Changes are very localized and I believe they are safe (though code inspection is always desired).

Please confirm if my patch has been accepted.

Michael.Waychison> Why do this in the parser when it can easily be done in Michael.Waychison> a mount module?

Quoted 1 line
Quoted 1 line

Care to expound a bit? I'm not sure what people use backfstype for,

Michael.Waychison> but if

Quoted 9 lines
Quoted 9 lines

it is generic, then you wouldn't want to handle every case in every mount module. But I think I'm missing your point.

It makes some sense to me to handle this above the mount module, simply because you could call into two different modules.

So, care to set me straight? ;)

-Jeff

Michael.Waychison> I'm CC'ing David as he may have a better view of what Michael.Waychison> the cachefs status is.

Michael.Waychison> Backfstype is a fstype=cachefs specific mount option. Michael.Waychison> Specifically:

Michael.Waychison> - add cachefs to the not_generic array in Michael.Waychison> daemon/mount.c - create a new mount module, Michael.Waychison> modules/mount_cachefs.c. This module would check for Michael.Waychison> cachefs support available and use it if available. Michael.Waychison> Otherwise it would rewrite the fstype with the Michael.Waychison> backfstype mount option and call do_mount again.

Okay, that makes much more sense now. Agreed.

Oh, and you forgot to CC David. ;)

-Jeff

#9 lore raw
In reply to Jeff Moyer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Resending as I forgot to CC David :)

Quoted 1 line · Jeff Moyer

==> Regarding Re: [autofs] backfstype patch.; Mike Waychison

<[email protected]> adds:

Quoted 20 lines

Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE----- Hash> SHA1

Quoted 14 lines · Michael.Waychison> Hans Deragon wrote:
Quoted 14 lines

Greetings.

Attached, my patch for supporting backfstype. If the OS is Linux and cachefs is detected, this fs is ignored and no attempt is made to mount a cachefs kernel module (none exist). This way we avoid useless error messages in syslog.

If mounting the fstype fails or is cachefs, backfstype is then tried.

It works fine under RHL 9. Only one file was changed: parse_sun.c. The changes were made from the 4.1.3 branch. Changes are very localized and I believe they are safe (though code inspection is always desired).

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Please confirm if my patch has been accepted.

Michael.Waychison> Why do this in the parser when it can easily be done in Michael.Waychison> a mount module?

Care to expound a bit? I'm not sure what people use backfstype for,

but if

Quoted 9 lines

it is generic, then you wouldn't want to handle every case in every mount module. But I think I'm missing your point.

It makes some sense to me to handle this above the mount module, simply because you could call into two different modules.

So, care to set me straight? ;)

-Jeff

I'm CC'ing David as he may have a better view of what the cachefs status is.

Backfstype is a fstype=cachefs specific mount option. Specifically:

- add cachefs to the not_generic array in daemon/mount.c
- create a new mount module, modules/mount_cachefs.c. This module
would check for cachefs support available and use it if available. Otherwise it would rewrite the fstype with the backfstype mount option and call do_mount again.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA4s4fdQs4kOxk3/MRAvw7AJ9THSEKPZ2FFP73r60fb3QASiJ9RgCggOE0 Csu1J3seKze4LGzuKfvbgh8=
=o36j
-----END PGP SIGNATURE-----

#3 lore raw
In reply to Jeff Moyer

Greetings Jeff.

Quoted 9 lines · Jeff Moyer

==> Regarding [autofs] backfstype patch.; Hans Deragon <[email protected]> adds:

hans> Greetings. Attached, my patch for supporting backfstype. If the OS hans> is Linux and cachefs is detected, this fs is ignored and no attempt hans> is made to mount a cachefs kernel module (none exist). This way we hans> avoid useless error messages in syslog.

First off, thanks for taking the initiative!

Quoted 7 lines

Now, to business. Ian meant to say that you _don't_ need to do #ifdef __linux__, as this is the Linux automounter. It won't work on any other OS.

I'm not sure I like the special casing for cachefs, but that's ultimately Ian's call. I just attempted a mount -t cachefs on my machine, and got no messages in the logs. I wonder what's trying the modprobe.

I got messages in my logs.

Quoted 22 lines

I've taken a cursory look at your patch, and inlined some initial comments. I'll try to take a closer look at it some time this week.

Thanks!

Jeff

Quoted 12 lines

diff -Nur autofs-4.1.3.org/modules/parse_sun.c autofs-4.1.3/modules/parse_sun.c

modules/parse_sun.c +0 -1
@@ -22,7 +22,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
-#include <syslog.h>
 #include <string.h>
 #include <syslog.h>
 #include <ctype.h>
@@ -516,17 +515,20 @@
Quoted 8 lines

modules/parse_sun.c line 518

Quoted 5 lines
modules/parse_sun.c +1 -1
 static int sun_mount(const char *root, const char *name, int namelen,
 		     const char *loc, int loclen, const char *options)
 {
-	char *fstype = "nfs";	/* Default filesystem type */
+	char *fstype     = "nfs"; /* Default filesystem type */

Bad form to change spacing.

Better alignment with new variable backfstype. Looks cleaner.

Quoted 19 lines

[snip]

modules/parse_sun.c line 564

Quoted 13 lines
modules/parse_sun.c +9 -0
@@ -551,6 +553,15 @@
 				fstype = alloca(typelen + 1);
 				memcpy(fstype, cp + 7, typelen);
 				fstype[typelen] = '\0';
+			} else if (strncmp("backfstype=", cp, 11) == 0) {
+				int typelen = comma - (cp + 11);
+				backfstype = alloca(typelen + 1);
+				memcpy(backfstype, cp + 11, typelen);
+				backfstype[typelen] = '\0';
+#if 0
+			} else if (strncmp("cachedir=", cp, 9) == 0) {
+        /* Ignoring cachedir, since cachefs is not supported. */
+#endif

Ick.

Ick what?

Quoted 16 lines

[snip]

modules/parse_sun.c line 621

Quoted 10 lines
modules/parse_sun.c +10 -0
+#ifdef __linux__
+		if (!strcmp(curfstype, "cachefs")) {
+			/* cachefs not supported for Linux.  We do not even try because when
+			   we try, mount will complain about the module being absent.  This is
+			   not desired because if backfstype parameter is provided and works,
+			   we sure do not want any error messages reported to syslog. */
+			debug("cachefs not implemented under Linux and thus ignored.");
+			continue;
+		}
+#endif

Don't need the ifdef. Also, try to keep w/in 80 columns, please.

#ifdef could be removed. And it is 80 columns! Set your tabstops at 2. :) Granted, I have to figure out what your tab settings are, and my I suggest that you ban tabs all together? I never found any value to use tabs, but always grief with alignements.

Quoted 8 lines

modules/parse_sun.c line 625

Quoted 4 lines
modules/parse_sun.c +4 -0
+
+		if (!strcmp(curfstype, "nfs")) {
+			/* Removing cachedir parameter which is not understood by nfs. */
+			start=strstr(noptions, ",cachedir=");

You don't really need to do this. We use the sloppy (-s) option to mount, which just ignore unrecognized options.

When I tested, nfs mount would fail when cachedir was present. Are you sure that -s is sent to the mount command and it works?

Quoted 11 lines

[snip]

modules/parse_sun.c line 660

Quoted 4 lines
modules/parse_sun.c +4 -0
+		if(!rv)
+		{
+			break;
+		}

Keep to coding style: { on same line as if.

Agree.

Thanks for the comments.
Hans Deragon
--
Consultant en informatique/Software Consultant

Deragon Informatique inc.     Open source:
http://www.deragon.biz        http://facil.qc.ca (Promotion du libre)
mailto://[email protected]     http://autopoweroff.sourceforge.net (Logiciel)
#8 lore raw
In reply to Mike Waychison
Quoted 28 lines · Mike Waychison
Quoted 4 lines

Michael.Waychison> Why do this in the parser when it can easily be done in Michael.Waychison> a mount module?

Care to expound a bit? I'm not sure what people use backfstype for,

but if

Quoted 9 lines

it is generic, then you wouldn't want to handle every case in every mount module. But I think I'm missing your point.

It makes some sense to me to handle this above the mount module, simply because you could call into two different modules.

So, care to set me straight? ;)

-Jeff

I'm CC'ing David as he may have a better view of what the cachefs status is.

Backfstype is a fstype=cachefs specific mount option. Specifically:

- add cachefs to the not_generic array in daemon/mount.c
- create a new mount module, modules/mount_cachefs.c. This module
would check for cachefs support available and use it if available. Otherwise it would rewrite the fstype with the backfstype mount option and call do_mount again.

Quoted 6 lines

- --
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice
http://www.sun.com

Great.

Is this issue in someone's else hands? The reason I coded the solution in
parse_sun.c is simply because I know nada about automount and I wanted a quick solution. I did not take the time to study automount's architecture to understand the big picture, and I won't have the time to do this either. :( Worse, I do not know much about C coding and particularly the available API for Linux system calls. However, I would like to see some solution taking care of backfstype being implemented in the next release. Can someone please take the initiative? You guys seam to understand the issue much better than I.

Best regards,
Hans Deragon
--
Consultant en informatique/Software Consultant

Deragon Informatique inc.     Open source:
http://www.deragon.biz        http://facil.qc.ca (Promotion du libre)
mailto://[email protected]     http://autopoweroff.sourceforge.net (Logiciel)