2002-02-28 23:55:34

by Olaf Dietsche

[permalink] [raw]
Subject: [PATCH] 2.5.5: compile error in fs/filesystems.c

Hi Neil,

here is a patch to fix fs/filesystems.c, if you configure neither NFSD
nor NFSD_MODULE, but CONFIG_MODULES.

Regards, Olaf.

--- v2.5.5/fs/filesystems.c Thu Feb 28 22:41:18 2002
+++ linux/fs/filesystems.c Fri Mar 1 00:16:29 2002
@@ -15,14 +15,17 @@
#include <linux/linkage.h>

#if ! defined(CONFIG_NFSD)
+#if defined(CONFIG_NFSD_MODULES)
struct nfsd_linkage *nfsd_linkage;
+EXPORT_SYMBOL(nfsd_linkage);
+#endif

long
asmlinkage sys_nfsservctl(int cmd, void *argp, void *resp)
{
int ret = -ENOSYS;

-#if defined(CONFIG_MODULES)
+#if defined(CONFIG_NFSD_MODULES)
lock_kernel();

if (nfsd_linkage ||
@@ -36,6 +39,5 @@
#endif
return ret;
}
-EXPORT_SYMBOL(nfsd_linkage);

#endif /* CONFIG_NFSD */


2002-03-01 01:05:42

by Olaf Dietsche

[permalink] [raw]
Subject: Re: [PATCH] 2.5.5: compile error in fs/filesystems.c

Hi Neil,

Neil Brown <[email protected]> writes:

> 2.5.6-pre2 already has a patch for this.

The compile error is gone, *but* ... :-)
With 2.5.6-pre2 you get nfsd support, wether you want it or
not. Consider this:

#undef CONFIG_NFSD
#undef CONFIG_NFSD_MODULE
#define CONFIG_MODULES

Now, this part is compiled into the kernel, although you haven't
requested it:

#if defined(CONFIG_MODULES)
lock_kernel();

if (nfsd_linkage ||
(request_module ("nfsd") == 0 && nfsd_linkage)) {
__MOD_INC_USE_COUNT(nfsd_linkage->owner);
unlock_kernel();
ret = nfsd_linkage->do_nfsservctl(cmd, argp, resp);
__MOD_DEC_USE_COUNT(nfsd_linkage->owner);
} else
unlock_kernel();
#endif

Did I miss something?

Regards, Olaf.

2002-03-01 01:14:07

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH] 2.5.5: compile error in fs/filesystems.c

On Friday March 1, [email protected] wrote:
> Hi Neil,
>
> Neil Brown <[email protected]> writes:
>
> > 2.5.6-pre2 already has a patch for this.
>
> The compile error is gone, *but* ... :-)
> With 2.5.6-pre2 you get nfsd support, wether you want it or
> not. Consider this:

With 2.5.6-pre2 you will always get just enough code to be able to
load nfsd as a module later, even if you didn't compile nfsd as a
module this time. Unless modules are disabled of course.

There have been a number of problem reports on linux-kernel over the
last year or two from people who cannot load nfsd.o as a module.
Often it is because they originally compiled without and NFSD support
at all, but subsequently decided that wanted to compile and load
nfsd.o

This works for many modules (e.g. filesystems) It is reasonable that
it work for nfsd as well.

I thought that the cost of always including the hooks to load nfsd was
minimal, and worth the consistency/convenience.

Does that seem reasonable to you?

NeilBrown

2002-03-01 07:56:38

by Olaf Dietsche

[permalink] [raw]
Subject: Re: [PATCH] 2.5.5: compile error in fs/filesystems.c

Hi Neil,

Neil Brown <[email protected]> writes:

> There have been a number of problem reports on linux-kernel over the
> last year or two from people who cannot load nfsd.o as a module.
> Often it is because they originally compiled without and NFSD support
> at all, but subsequently decided that wanted to compile and load
> nfsd.o
>
> This works for many modules (e.g. filesystems) It is reasonable that
> it work for nfsd as well.
>
> I thought that the cost of always including the hooks to load nfsd was
> minimal, and worth the consistency/convenience.
>
> Does that seem reasonable to you?

Ok, I didn't think of that. Thanks for clarifying.

Regards, Olaf.