* backfstype patch.
@ 2004-06-29 20:10 Hans Deragon
2004-06-30 13:26 ` Jeff Moyer
2004-06-30 13:31 ` Mike Waychison
0 siblings, 2 replies; 15+ messages in thread
From: Hans Deragon @ 2004-06-29 20:10 UTC (permalink / raw)
To: autofs
[-- Attachment #1: Type: text/plain, Size: 865 bytes --]
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://hans@deragon.biz http://autopoweroff.sourceforge.net (Logiciel)
[-- Attachment #2: autofs-4.1.3-backfstype.patch --]
[-- Type: text/plain, Size: 3956 bytes --]
diff -Nur autofs-4.1.3.org/modules/parse_sun.c autofs-4.1.3/modules/parse_sun.c
--- autofs-4.1.3.org/modules/parse_sun.c 2004-05-18 08:22:40.000000000 -0400
+++ autofs-4.1.3/modules/parse_sun.c 2004-06-29 14:54:49.000000000 -0400
@@ -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) {
[-- Attachment #3: Type: text/plain, Size: 140 bytes --]
_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-29 20:10 Hans Deragon
@ 2004-06-30 13:26 ` Jeff Moyer
2004-06-30 14:00 ` raven
2004-06-30 15:01 ` Hans Deragon
2004-06-30 13:31 ` Mike Waychison
1 sibling, 2 replies; 15+ messages in thread
From: Jeff Moyer @ 2004-06-30 13:26 UTC (permalink / raw)
To: Hans Deragon; +Cc: autofs
==> Regarding [autofs] backfstype patch.; Hans Deragon <hans@deragon.biz> 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
>diff -Nur autofs-4.1.3.org/modules/parse_sun.c autofs-4.1.3/modules/parse_sun.c
>--- autofs-4.1.3.org/modules/parse_sun.c 2004-05-18 08:22:40.000000000 -0400
>+++ autofs-4.1.3/modules/parse_sun.c 2004-06-29 14:54:49.000000000 -0400
>@@ -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 */
Bad form to change spacing.
[snip]
>@@ -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]
>+#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.
>+
>+ 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]
>+ if(!rv)
>+ {
>+ break;
>+ }
Keep to coding style: { on same line as if.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-29 20:10 Hans Deragon
2004-06-30 13:26 ` Jeff Moyer
@ 2004-06-30 13:31 ` Mike Waychison
2004-06-30 13:51 ` Jeff Moyer
1 sibling, 1 reply; 15+ messages in thread
From: Mike Waychison @ 2004-06-30 13:31 UTC (permalink / raw)
To: Hans Deragon; +Cc: autofs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hans Deragon wrote:
> 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.
>
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-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-30 13:31 ` Mike Waychison
@ 2004-06-30 13:51 ` Jeff Moyer
2004-06-30 14:20 ` Mike Waychison
2004-06-30 14:28 ` Mike Waychison
0 siblings, 2 replies; 15+ messages in thread
From: Jeff Moyer @ 2004-06-30 13:51 UTC (permalink / raw)
To: Mike Waychison; +Cc: autofs
==> Regarding Re: [autofs] backfstype patch.; Mike Waychison <Michael.Waychison@Sun.COM> adds:
Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE-----
Hash> SHA1
Michael.Waychison> Hans Deragon wrote:
>> 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.
>>
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-30 13:26 ` Jeff Moyer
@ 2004-06-30 14:00 ` raven
2004-06-30 15:01 ` Hans Deragon
1 sibling, 0 replies; 15+ messages in thread
From: raven @ 2004-06-30 14:00 UTC (permalink / raw)
To: Jeff Moyer; +Cc: autofs mailing list
On Wed, 30 Jun 2004, Jeff Moyer wrote:
> >+ 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.
> >+ 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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-30 13:51 ` Jeff Moyer
@ 2004-06-30 14:20 ` Mike Waychison
2004-06-30 14:22 ` Jeff Moyer
2004-06-30 15:11 ` Hans Deragon
2004-06-30 14:28 ` Mike Waychison
1 sibling, 2 replies; 15+ messages in thread
From: Mike Waychison @ 2004-06-30 14:20 UTC (permalink / raw)
To: jmoyer; +Cc: autofs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jeff Moyer wrote:
> ==> Regarding Re: [autofs] backfstype patch.; Mike Waychison
<Michael.Waychison@Sun.COM> adds:
>
> Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE-----
> Hash> SHA1
>
> Michael.Waychison> Hans Deragon wrote:
>
>>>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.
>>>
>
>
> 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
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-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-30 14:20 ` Mike Waychison
@ 2004-06-30 14:22 ` Jeff Moyer
2004-06-30 15:11 ` Hans Deragon
1 sibling, 0 replies; 15+ messages in thread
From: Jeff Moyer @ 2004-06-30 14:22 UTC (permalink / raw)
To: Mike Waychison; +Cc: autofs
==> Regarding Re: [autofs] backfstype patch.; Mike Waychison <Michael.Waychison@Sun.COM> adds:
Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE-----
Hash> SHA1
Michael.Waychison> Jeff Moyer wrote:
>> ==> Regarding Re: [autofs] backfstype patch.; Mike Waychison
>> Michael.Waychison@Sun.COM> adds:
>>
Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE-----
Hash> SHA1
>>
Michael.Waychison> Hans Deragon wrote:
>>
>>>> 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.
>>>>
>>
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,
Michael.Waychison> 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
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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-30 13:51 ` Jeff Moyer
2004-06-30 14:20 ` Mike Waychison
@ 2004-06-30 14:28 ` Mike Waychison
1 sibling, 0 replies; 15+ messages in thread
From: Mike Waychison @ 2004-06-30 14:28 UTC (permalink / raw)
To: jmoyer; +Cc: autofs, dhowells
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Resending as I forgot to CC David :)
Jeff Moyer wrote:
> ==> Regarding Re: [autofs] backfstype patch.; Mike Waychison
<Michael.Waychison@Sun.COM> adds:
>
> Michael.Waychison> -----BEGIN PGP SIGNED MESSAGE-----
> Hash> SHA1
>
> Michael.Waychison> Hans Deragon wrote:
>
>>>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.
>>>
>
>
> 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
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-----
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-30 13:26 ` Jeff Moyer
2004-06-30 14:00 ` raven
@ 2004-06-30 15:01 ` Hans Deragon
1 sibling, 0 replies; 15+ messages in thread
From: Hans Deragon @ 2004-06-30 15:01 UTC (permalink / raw)
To: autofs
Greetings Jeff.
Jeff Moyer wrote:
> ==> Regarding [autofs] backfstype patch.; Hans Deragon <hans@deragon.biz> 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 got messages in my logs.
> 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
>
>
>
>
>>diff -Nur autofs-4.1.3.org/modules/parse_sun.c autofs-4.1.3/modules/parse_sun.c
>>--- autofs-4.1.3.org/modules/parse_sun.c 2004-05-18 08:22:40.000000000 -0400
>>+++ autofs-4.1.3/modules/parse_sun.c 2004-06-29 14:54:49.000000000 -0400
>>@@ -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 */
>
>
> Bad form to change spacing.
Better alignment with new variable backfstype. Looks cleaner.
> [snip]
>
>
>>@@ -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?
> [snip]
>
>
>>+#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.
>>+
>>+ 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?
>
> [snip]
>
>
>>+ 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://hans@deragon.biz http://autopoweroff.sourceforge.net (Logiciel)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-06-30 14:20 ` Mike Waychison
2004-06-30 14:22 ` Jeff Moyer
@ 2004-06-30 15:11 ` Hans Deragon
1 sibling, 0 replies; 15+ messages in thread
From: Hans Deragon @ 2004-06-30 15:11 UTC (permalink / raw)
Cc: autofs
Mike Waychison wrote:
>>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
>
>
> 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
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://hans@deragon.biz http://autopoweroff.sourceforge.net (Logiciel)
^ permalink raw reply [flat|nested] 15+ messages in thread
* backfstype patch.
@ 2004-07-16 18:45 Hans Deragon
2004-07-16 19:01 ` Jeff Moyer
2004-07-17 4:16 ` raven
0 siblings, 2 replies; 15+ messages in thread
From: Hans Deragon @ 2004-07-16 18:45 UTC (permalink / raw)
To: autofs
Greetings.
Remember me with my backfstype patch? Some people commented on it, I replied
and then never got any answers since. Altough functional, my patch was
questionned; the fix was not at the right place within the code (from a
design/elegance point of view; technically it works great). As I explained, I
have no knowledge of the overall architecture of Autofs and unfortunatly, I do
not have the time to get deep into it.
Can my patch still be applied in the main branch until it is moved into a
more appropriate area of the code? Its still adds the new backsftype support,
does not cause any problems, is very localized, and very usefull. I have been
running it since the last 2 weeks without any problems. I am rolling it out in
the production environment.
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://hans@deragon.biz http://autopoweroff.sourceforge.net (Logiciel)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-07-16 18:45 backfstype patch Hans Deragon
@ 2004-07-16 19:01 ` Jeff Moyer
2005-03-02 21:03 ` Greg Bradner
2004-07-17 4:16 ` raven
1 sibling, 1 reply; 15+ messages in thread
From: Jeff Moyer @ 2004-07-16 19:01 UTC (permalink / raw)
To: Hans Deragon; +Cc: autofs
==> Regarding [autofs] backfstype patch.; Hans Deragon <hans@deragon.biz> adds:
hans> Greetings. Remember me with my backfstype patch? Some people
hans> commented on it, I replied and then never got any answers since.
hans> Altough functional, my patch was questionned; the fix was not at the
hans> right place within the code (from a design/elegance point of view;
hans> technically it works great). As I explained, I have no knowledge of
hans> the overall architecture of Autofs and unfortunatly, I do not have
hans> the time to get deep into it.
hans> Can my patch still be applied in the main branch until it is moved
hans> into a more appropriate area of the code? Its still adds the new
hans> backsftype support, does not cause any problems, is very localized,
hans> and very usefull. I have been running it since the last 2 weeks
hans> without any problems. I am rolling it out in the production
hans> environment.
Ultimately, this is up to Ian. I have a todo list item to implement a
cachefs mount module (which was the agreed upon correct approach).
Unfortunately, it's quite low on the todo list. :(
-Jeff
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-07-16 18:45 backfstype patch Hans Deragon
2004-07-16 19:01 ` Jeff Moyer
@ 2004-07-17 4:16 ` raven
1 sibling, 0 replies; 15+ messages in thread
From: raven @ 2004-07-17 4:16 UTC (permalink / raw)
To: Hans Deragon; +Cc: autofs
On Fri, 16 Jul 2004, Hans Deragon wrote:
> Greetings.
>
>
> Remember me with my backfstype patch? Some people commented on it, I replied
> and then never got any answers since. Altough functional, my patch was
> questionned; the fix was not at the right place within the code (from a
> design/elegance point of view; technically it works great). As I explained, I
> have no knowledge of the overall architecture of Autofs and unfortunatly, I do
> not have the time to get deep into it.
>
> Can my patch still be applied in the main branch until it is moved into a
> more appropriate area of the code? Its still adds the new backsftype support,
> does not cause any problems, is very localized, and very usefull. I have been
> running it since the last 2 weeks without any problems. I am rolling it out in
> the production environment.
I'm still working on the stuff I was working on when I originally replied
to your request. I had a brief look at it then but I'm not likely to take
a serious look at it for a while yet.
Ian
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2004-07-16 19:01 ` Jeff Moyer
@ 2005-03-02 21:03 ` Greg Bradner
2005-03-03 2:15 ` Ian Kent
0 siblings, 1 reply; 15+ messages in thread
From: Greg Bradner @ 2005-03-02 21:03 UTC (permalink / raw)
To: autofs
I am thinking about using cachefs on suse 9.2 and was wondering the
status of the cachefs mount module?
I'm currently running autofs-4.1.3 with 2.6.10 kernel.
Jeff Moyer wrote:
>==> Regarding [autofs] backfstype patch.; Hans Deragon <hans@deragon.biz> adds:
>
>hans> Greetings. Remember me with my backfstype patch? Some people
>hans> commented on it, I replied and then never got any answers since.
>hans> Altough functional, my patch was questionned; the fix was not at the
>hans> right place within the code (from a design/elegance point of view;
>hans> technically it works great). As I explained, I have no knowledge of
>hans> the overall architecture of Autofs and unfortunatly, I do not have
>hans> the time to get deep into it.
>
>hans> Can my patch still be applied in the main branch until it is moved
>hans> into a more appropriate area of the code? Its still adds the new
>hans> backsftype support, does not cause any problems, is very localized,
>hans> and very usefull. I have been running it since the last 2 weeks
>hans> without any problems. I am rolling it out in the production
>hans> environment.
>
>Ultimately, this is up to Ian. I have a todo list item to implement a
>cachefs mount module (which was the agreed upon correct approach).
>Unfortunately, it's quite low on the todo list. :(
>
>-Jeff
>
>_______________________________________________
>autofs mailing list
>autofs@linux.kernel.org
>http://linux.kernel.org/mailman/listinfo/autofs
>
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rhythm & Hues
5404 Jandy Place
Los Angeles, CA 90066
Voice: 310 448-7763
Fax: 310 448-7600
gregb@rhythm.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: backfstype patch.
2005-03-02 21:03 ` Greg Bradner
@ 2005-03-03 2:15 ` Ian Kent
0 siblings, 0 replies; 15+ messages in thread
From: Ian Kent @ 2005-03-03 2:15 UTC (permalink / raw)
To: Greg Bradner; +Cc: autofs
On Wed, 2 Mar 2005, Greg Bradner wrote:
> I am thinking about using cachefs on suse 9.2 and was wondering the
> status of the cachefs mount module?
> I'm currently running autofs-4.1.3 with 2.6.10 kernel.
I'll be collecting stuff for 4.1.5 soon.
I can't decide on priorities until I can see what's to be done.
I don't know who else might be working on this.
>
> Jeff Moyer wrote:
>
> >==> Regarding [autofs] backfstype patch.; Hans Deragon <hans@deragon.biz> adds:
> >
> >hans> Greetings. Remember me with my backfstype patch? Some people
> >hans> commented on it, I replied and then never got any answers since.
> >hans> Altough functional, my patch was questionned; the fix was not at the
> >hans> right place within the code (from a design/elegance point of view;
> >hans> technically it works great). As I explained, I have no knowledge of
> >hans> the overall architecture of Autofs and unfortunatly, I do not have
> >hans> the time to get deep into it.
> >
> >hans> Can my patch still be applied in the main branch until it is moved
> >hans> into a more appropriate area of the code? Its still adds the new
> >hans> backsftype support, does not cause any problems, is very localized,
> >hans> and very usefull. I have been running it since the last 2 weeks
> >hans> without any problems. I am rolling it out in the production
> >hans> environment.
> >
> >Ultimately, this is up to Ian. I have a todo list item to implement a
> >cachefs mount module (which was the agreed upon correct approach).
> >Unfortunately, it's quite low on the todo list. :(
> >
> >-Jeff
> >
> >_______________________________________________
> >autofs mailing list
> >autofs@linux.kernel.org
> >http://linux.kernel.org/mailman/listinfo/autofs
> >
> >
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Rhythm & Hues
> 5404 Jandy Place
> Los Angeles, CA 90066
> Voice: 310 448-7763
> Fax: 310 448-7600
> gregb@rhythm.com
>
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs
>
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2005-03-03 2:15 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-16 18:45 backfstype patch Hans Deragon
2004-07-16 19:01 ` Jeff Moyer
2005-03-02 21:03 ` Greg Bradner
2005-03-03 2:15 ` Ian Kent
2004-07-17 4:16 ` raven
-- strict thread matches above, loose matches on Subject: below --
2004-06-29 20:10 Hans Deragon
2004-06-30 13:26 ` Jeff Moyer
2004-06-30 14:00 ` raven
2004-06-30 15:01 ` Hans Deragon
2004-06-30 13:31 ` Mike Waychison
2004-06-30 13:51 ` Jeff Moyer
2004-06-30 14:20 ` Mike Waychison
2004-06-30 14:22 ` Jeff Moyer
2004-06-30 15:11 ` Hans Deragon
2004-06-30 14:28 ` Mike Waychison
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.