* linux-2.5.7 @ 2002-03-30 23:23 Timothy Murphy 2002-03-30 23:41 ` linux-2.5.7 Alexander Viro 2002-03-31 3:25 ` linux-2.5.7 Pierre Rousselet 0 siblings, 2 replies; 13+ messages in thread From: Timothy Murphy @ 2002-03-30 23:23 UTC (permalink / raw) To: linux-kernel I'm sure this has been recognised, but I would point out that sys_nfsservctl is not "undefined" if NFSD is not chosen. The following patch to .../arch/i386/kernel/entry.S corrects this, though this is obviously not the right place to put it: =============================================================== --- entry.S.bak Mon Mar 18 20:37:09 2002 +++ entry.S Thu Mar 28 15:59:20 2002 @@ -40,6 +40,11 @@ * "current" is in register %ebx during any slow entries. */ +#if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE) +#else +#define sys_nfsservctl sys_ni_syscall +#endif + #include <linux/config.h> #include <linux/sys.h> #include <linux/linkage.h> =============================================================== -- Timothy Murphy e-mail: tim@birdsnest.maths.tcd.ie tel: 086-233 6090 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-30 23:23 linux-2.5.7 Timothy Murphy @ 2002-03-30 23:41 ` Alexander Viro 2002-03-31 2:22 ` linux-2.5.7 David S. Miller 2002-03-31 3:25 ` linux-2.5.7 Pierre Rousselet 1 sibling, 1 reply; 13+ messages in thread From: Alexander Viro @ 2002-03-30 23:41 UTC (permalink / raw) To: Timothy Murphy; +Cc: David S. Miller, linux-kernel On Sat, 30 Mar 2002, Timothy Murphy wrote: > I'm sure this has been recognised, > but I would point out that sys_nfsservctl is not "undefined" > if NFSD is not chosen. > > The following patch to .../arch/i386/kernel/entry.S corrects this, > though this is obviously not the right place to put it: Wrong fix. Using weak aliases would do it in cleaner way, but there's a sparc64 toolchain bugs that don't allow that. Dave, you've mentioned doing the equivalent of __attribute__((weak,alias("foo")) by hand. Could you give an example? ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-30 23:41 ` linux-2.5.7 Alexander Viro @ 2002-03-31 2:22 ` David S. Miller 2002-03-31 7:54 ` linux-2.5.7 Alexander Viro 0 siblings, 1 reply; 13+ messages in thread From: David S. Miller @ 2002-03-31 2:22 UTC (permalink / raw) To: viro; +Cc: tim, linux-kernel From: Alexander Viro <viro@math.psu.edu> Date: Sat, 30 Mar 2002 18:41:46 -0500 (EST) Dave, you've mentioned doing the equivalent of __attribute__((weak,alias("foo")) by hand. Could you give an example? #define make_weak(foo,bar) __asm__(".weak foo, bar") Or however the assembler syntax works. GLIBC has some header file it at least used to use which had macros doing something similar. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-31 2:22 ` linux-2.5.7 David S. Miller @ 2002-03-31 7:54 ` Alexander Viro 2002-03-31 8:30 ` linux-2.5.7 Andrew Morton 2002-04-04 9:42 ` linux-2.5.7 Richard Henderson 0 siblings, 2 replies; 13+ messages in thread From: Alexander Viro @ 2002-03-31 7:54 UTC (permalink / raw) To: David S. Miller; +Cc: tim, linux-kernel On Sat, 30 Mar 2002, David S. Miller wrote: > From: Alexander Viro <viro@math.psu.edu> > Date: Sat, 30 Mar 2002 18:41:46 -0500 (EST) > > Dave, you've mentioned doing the equivalent of > __attribute__((weak,alias("foo")) by hand. Could you give an example? > > > #define make_weak(foo,bar) __asm__(".weak foo, bar") > > Or however the assembler syntax works. GLIBC has some header file it > at least used to use which had macros doing something similar. OK... How about the following? diff -urN C7-0/fs/Makefile C7-1/fs/Makefile --- C7-0/fs/Makefile Tue Mar 19 16:05:56 2002 +++ C7-1/fs/Makefile Sun Mar 31 02:52:35 2002 @@ -16,12 +16,6 @@ dcache.o inode.o attr.o bad_inode.o file.o iobuf.o dnotify.o \ filesystems.o namespace.o seq_file.o xattr.o libfs.o -ifeq ($(CONFIG_QUOTA),y) -obj-y += dquot.o -else -obj-y += noquot.o -endif - ifneq ($(CONFIG_NFSD),n) ifneq ($(CONFIG_NFSD),) obj-y += nfsctl.o @@ -84,6 +78,8 @@ obj-y += binfmt_script.o obj-$(CONFIG_BINFMT_ELF) += binfmt_elf.o + +obj-$(CONFIG_QUOTA) += dquot.o # persistent filesystems obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o)) diff -urN C7-0/fs/dquot.c C7-1/fs/dquot.c --- C7-0/fs/dquot.c Tue Feb 19 22:33:03 2002 +++ C7-1/fs/dquot.c Sun Mar 31 02:52:35 2002 @@ -59,6 +59,7 @@ #include <linux/tty.h> #include <linux/file.h> #include <linux/slab.h> +#include <linux/sysctl.h> #include <linux/smp_lock.h> #include <linux/init.h> @@ -1240,9 +1241,22 @@ return ret; } +static ctl_table fs_table[] = { + {FS_NRDQUOT, "dquot-nr", &nr_dquots, 2*sizeof(int), + 0444, NULL, &proc_dointvec}, + {}, +}; + +static ctl_table dquot_table[] = { + {CTL_FS, "fs", NULL, 0, 0555, fs_table}, + {}, +}; + static int __init dquot_init(void) { int i; + + register_sysctl_table(dquot_table, 0); for (i = 0; i < NR_DQHASH; i++) INIT_LIST_HEAD(dquot_hash + i); diff -urN C7-0/fs/noquot.c C7-1/fs/noquot.c --- C7-0/fs/noquot.c Fri May 12 14:21:20 2000 +++ C7-1/fs/noquot.c Wed Dec 31 19:00:00 1969 @@ -1,15 +0,0 @@ -/* noquot.c: Quota stubs necessary for when quotas are not - * compiled into the kernel. - */ - -#include <linux/kernel.h> -#include <linux/types.h> -#include <linux/errno.h> - -int nr_dquots, nr_free_dquots; -int max_dquots; - -asmlinkage long sys_quotactl(int cmd, const char *special, int id, caddr_t addr) -{ - return(-ENOSYS); -} diff -urN C7-0/include/linux/quota.h C7-1/include/linux/quota.h --- C7-0/include/linux/quota.h Mon Jan 14 23:13:52 2002 +++ C7-1/include/linux/quota.h Sun Mar 31 02:52:35 2002 @@ -144,7 +144,6 @@ #ifdef __KERNEL__ -extern int nr_dquots, nr_free_dquots; extern int dquot_root_squash; #define NR_DQHASH 43 /* Just an arbitrary number */ diff -urN C7-0/kernel/Makefile C7-1/kernel/Makefile --- C7-0/kernel/Makefile Tue Mar 19 16:06:01 2002 +++ C7-1/kernel/Makefile Sun Mar 31 02:52:35 2002 @@ -14,12 +14,13 @@ obj-y = sched.o dma.o fork.o exec_domain.o panic.o printk.o \ module.o exit.o itimer.o info.o time.o softirq.o resource.o \ - sysctl.o acct.o capability.o ptrace.o timer.o user.o \ + sysctl.o capability.o ptrace.o timer.o user.o \ signal.o sys.o kmod.o context.o futex.o obj-$(CONFIG_UID16) += uid16.o obj-$(CONFIG_MODULES) += ksyms.o obj-$(CONFIG_PM) += pm.o +obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o ifneq ($(CONFIG_IA64),y) # According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is diff -urN C7-0/kernel/acct.c C7-1/kernel/acct.c --- C7-0/kernel/acct.c Tue Mar 19 16:06:01 2002 +++ C7-1/kernel/acct.c Sun Mar 31 02:52:35 2002 @@ -44,17 +44,11 @@ */ #include <linux/config.h> -#include <linux/errno.h> -#include <linux/kernel.h> - -#ifdef CONFIG_BSD_PROCESS_ACCT #include <linux/mm.h> #include <linux/slab.h> #include <linux/acct.h> -#include <linux/smp_lock.h> #include <linux/file.h> #include <linux/tty.h> - #include <asm/uaccess.h> /* @@ -397,15 +391,3 @@ spin_unlock(&acct_globals.lock); return 0; } - -#else -/* - * Dummy system call when BSD process accounting is not configured - * into the kernel. - */ - -asmlinkage long sys_acct(const char * filename) -{ - return -ENOSYS; -} -#endif diff -urN C7-0/kernel/exit.c C7-1/kernel/exit.c --- C7-0/kernel/exit.c Tue Mar 19 16:06:01 2002 +++ C7-1/kernel/exit.c Sun Mar 31 02:52:35 2002 @@ -14,9 +14,7 @@ #include <linux/personality.h> #include <linux/tty.h> #include <linux/namespace.h> -#ifdef CONFIG_BSD_PROCESS_ACCT #include <linux/acct.h> -#endif #include <linux/file.h> #include <linux/binfmts.h> @@ -493,9 +491,7 @@ del_timer_sync(&tsk->real_timer); fake_volatile: -#ifdef CONFIG_BSD_PROCESS_ACCT acct_process(code); -#endif __exit_mm(tsk); lock_kernel(); diff -urN C7-0/kernel/sys.c C7-1/kernel/sys.c --- C7-0/kernel/sys.c Tue Mar 19 16:06:01 2002 +++ C7-1/kernel/sys.c Sun Mar 31 02:52:49 2002 @@ -173,6 +173,18 @@ return -ENOSYS; } +/* + * "Conditional" syscalls + * + * What we want is __attribute__((weak,alias("sys_ni_syscall"))), + * but it doesn't work on sparc64, so we just do it by hand + */ +#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); + +cond_syscall(sys_nfsservctl) +cond_syscall(sys_quotactl) +cond_syscall(sys_acct) + static int proc_sel(struct task_struct *p, int which, int who) { if(p->pid) diff -urN C7-0/kernel/sysctl.c C7-1/kernel/sysctl.c --- C7-0/kernel/sysctl.c Tue Feb 19 22:33:08 2002 +++ C7-1/kernel/sysctl.c Sun Mar 31 02:52:35 2002 @@ -284,8 +284,6 @@ 0444, NULL, &proc_dointvec}, {FS_MAXFILE, "file-max", &files_stat.max_files, sizeof(int), 0644, NULL, &proc_dointvec}, - {FS_NRDQUOT, "dquot-nr", &nr_dquots, 2*sizeof(int), - 0444, NULL, &proc_dointvec}, {FS_DENTRY, "dentry-state", &dentry_stat, 6*sizeof(int), 0444, NULL, &proc_dointvec}, {FS_OVERFLOWUID, "overflowuid", &fs_overflowuid, sizeof(int), 0644, NULL, ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-31 7:54 ` linux-2.5.7 Alexander Viro @ 2002-03-31 8:30 ` Andrew Morton 2002-03-31 8:42 ` linux-2.5.7 Alexander Viro 2002-04-04 9:42 ` linux-2.5.7 Richard Henderson 1 sibling, 1 reply; 13+ messages in thread From: Andrew Morton @ 2002-03-31 8:30 UTC (permalink / raw) To: Alexander Viro; +Cc: David S. Miller, tim, linux-kernel Alexander Viro wrote: > > ... > +/* > + * "Conditional" syscalls > + * > + * What we want is __attribute__((weak,alias("sys_ni_syscall"))), > + * but it doesn't work on sparc64, so we just do it by hand > + */ > +#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); > + > +cond_syscall(sys_nfsservctl) > +cond_syscall(sys_quotactl) > +cond_syscall(sys_acct) > + Could you remind us what problem this is solving? The #ifdef approach seemed reasonable and there's no indication here why weak linkage is needed. Weak linkage could perhaps be useful elsewhere. Maybe this should be implemented as weak_symbol(sym, default_sym) in some generic header somewhere... - ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-31 8:30 ` linux-2.5.7 Andrew Morton @ 2002-03-31 8:42 ` Alexander Viro 0 siblings, 0 replies; 13+ messages in thread From: Alexander Viro @ 2002-03-31 8:42 UTC (permalink / raw) To: Andrew Morton; +Cc: David S. Miller, tim, linux-kernel On Sun, 31 Mar 2002, Andrew Morton wrote: > Could you remind us what problem this is solving? The > #ifdef approach seemed reasonable and there's no indication > here why weak linkage is needed. The thing we want here _is_ weak linkage - "return -ENOSYS unless you have the real thing". You can emulate that with ifdefs, but that's what it is - emulation. IOW, what we want actually belongs to linker, not compiler. When file looks like #ifdef FOO <lots of stuff> <function calling that stuff> #else <make that function an equivalent of sys_ni_syscall()> #endif we are really talking about "make it an alias of sys_ni_syscall() and let <all this stuff> override that". ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-31 7:54 ` linux-2.5.7 Alexander Viro 2002-03-31 8:30 ` linux-2.5.7 Andrew Morton @ 2002-04-04 9:42 ` Richard Henderson 2002-04-04 14:45 ` linux-2.5.7 Alvaro Figueroa 1 sibling, 1 reply; 13+ messages in thread From: Richard Henderson @ 2002-04-04 9:42 UTC (permalink / raw) To: Alexander Viro; +Cc: David S. Miller, tim, linux-kernel On Sun, Mar 31, 2002 at 02:54:14AM -0500, Alexander Viro wrote: > + * What we want is __attribute__((weak,alias("sys_ni_syscall"))), > + * but it doesn't work on sparc64, so we just do it by hand Rather, "the ancient version of gcc commonly used on sparc64". r~ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-04-04 9:42 ` linux-2.5.7 Richard Henderson @ 2002-04-04 14:45 ` Alvaro Figueroa 0 siblings, 0 replies; 13+ messages in thread From: Alvaro Figueroa @ 2002-04-04 14:45 UTC (permalink / raw) To: LKML; +Cc: David S. Miller, Richard Henderson > Rather, "the ancient version of gcc commonly used on sparc64". I'm sort of forwading a message I wrote at March 13th that was never answered and that I think has a huge priority for the sparc64 port. -- > GCC 3.0.3 works. > > (Dave S. Miller wrote) > I won't accept kernel bug reports for people using it though. > The old egcs64 compiler is the only thing I trust right now, still. In that case, I would repectfully comment that a special case comment should be added to the lkml FAQ (chapter 8, section 2), because there, it is stated: " 2. What are the recommended compiler/binutils for building kernels? * (REG) This depends on the kernel version. Until 26-OCT-2000, gcc 2.7.2.3 was the recommended compiler for all kernels. On this date, Linus announced that gcc 2.91.66 (aka egcs 1.1.2) is the recommended compiler for 2.4.x kernels up to version 2.4.9. Gcc 2.95.3 is the recommended compiler for kernel 2.4.10 and later. (...) Always see the Documentation/Changes file for details. " At Documentation/Changes you can read some negative comments about this version of the compiler, and it even says that is likely that 2.5 will drop egcs workarrounds. How will this be managed? What is the recommended compiler for 2.5? -- Alvaro Figueroa ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-30 23:23 linux-2.5.7 Timothy Murphy 2002-03-30 23:41 ` linux-2.5.7 Alexander Viro @ 2002-03-31 3:25 ` Pierre Rousselet 2002-03-31 6:21 ` linux-2.5.7 David S. Miller 1 sibling, 1 reply; 13+ messages in thread From: Pierre Rousselet @ 2002-03-31 3:25 UTC (permalink / raw) To: Timothy Murphy; +Cc: linux-kernel Timothy Murphy wrote: > I'm sure this has been recognised, > but I would point out that sys_nfsservctl is not "undefined" > if NFSD is not chosen. I've noticed 2.5.7 fails to build without tcp/ip enabled : sock.c:559: `TCP_LISTEN' undeclared sock.c:1192: `TCP_CLOSE' undeclared *and* without nfs choosen for the reason you give. Pierre -- ------------------------------------------------ Pierre Rousselet <pierre.rousselet@wanadoo.fr> ------------------------------------------------ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-31 3:25 ` linux-2.5.7 Pierre Rousselet @ 2002-03-31 6:21 ` David S. Miller 0 siblings, 0 replies; 13+ messages in thread From: David S. Miller @ 2002-03-31 6:21 UTC (permalink / raw) To: pierre.rousselet; +Cc: tim, linux-kernel From: Pierre Rousselet <pierre.rousselet@wanadoo.fr> Date: Sun, 31 Mar 2002 05:25:19 +0200 I've noticed 2.5.7 fails to build without tcp/ip enabled : sock.c:559: `TCP_LISTEN' undeclared sock.c:1192: `TCP_CLOSE' undeclared Just add an include of linux/tcp.h to net/core/sock.c, that should clear it up. I'll fix this in my sources. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7
@ 2002-03-30 23:48 Neil Brown
2002-03-31 0:02 ` linux-2.5.7 Keith Owens
0 siblings, 1 reply; 13+ messages in thread
From: Neil Brown @ 2002-03-30 23:48 UTC (permalink / raw)
To: Alexander Viro; +Cc: Timothy Murphy, linux-kernel
On Saturday March 30, viro@math.psu.edu wrote:
>
>
> On Sat, 30 Mar 2002, Timothy Murphy wrote:
>
> > I'm sure this has been recognised,
> > but I would point out that sys_nfsservctl is not "undefined"
> > if NFSD is not chosen.
> >
> > The following patch to .../arch/i386/kernel/entry.S corrects this,
> > though this is obviously not the right place to put it:
>
> Wrong fix. Using weak aliases would do it in cleaner way, but there's
> a sparc64 toolchain bugs that don't allow that.
I cannot see the weak aliases being a real fix either.
If you compile with NFSD as a module, and with CONFIG_KMOD, then the
nfssvc_ctl systemcall is suppose to auto-load nfsd.o. How can this be
achieved with weak aliases?
NeilBrown
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: linux-2.5.7 2002-03-30 23:48 linux-2.5.7 Neil Brown @ 2002-03-31 0:02 ` Keith Owens 2002-03-31 2:04 ` linux-2.5.7 Alexander Viro 0 siblings, 1 reply; 13+ messages in thread From: Keith Owens @ 2002-03-31 0:02 UTC (permalink / raw) To: Neil Brown; +Cc: linux-kernel On Sun, 31 Mar 2002 09:48:38 +1000 (EST), Neil Brown <neilb@cse.unsw.edu.au> wrote: >I cannot see the weak aliases being a real fix either. >If you compile with NFSD as a module, and with CONFIG_KMOD, then the >nfssvc_ctl systemcall is suppose to auto-load nfsd.o. How can this be >achieved with weak aliases? System calls cannot be in modules. Linus forbids it (that way lies "extend and embrace") and at least two architectures (ia64, ppc64) break when a syscall is in a module. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: linux-2.5.7 2002-03-31 0:02 ` linux-2.5.7 Keith Owens @ 2002-03-31 2:04 ` Alexander Viro 0 siblings, 0 replies; 13+ messages in thread From: Alexander Viro @ 2002-03-31 2:04 UTC (permalink / raw) To: Keith Owens; +Cc: Neil Brown, linux-kernel On Sun, 31 Mar 2002, Keith Owens wrote: > On Sun, 31 Mar 2002 09:48:38 +1000 (EST), > Neil Brown <neilb@cse.unsw.edu.au> wrote: > >I cannot see the weak aliases being a real fix either. > >If you compile with NFSD as a module, and with CONFIG_KMOD, then the > >nfssvc_ctl systemcall is suppose to auto-load nfsd.o. How can this be > >achieved with weak aliases? > > System calls cannot be in modules. Linus forbids it (that way lies > "extend and embrace") and at least two architectures (ia64, ppc64) > break when a syscall is in a module. Yup. The logics being: if we have neither CONFIG_NFSD nor CONFIG_NFSD_MODULE sys_nfsservctl() is alias for sys_ni_syscall() else sys_nfsservctl() is defined in fs/nfsct.c and does do_kern_mount() with type "nfsd", which triggers autoload if nfsd is modular. Whether nfsd is modular or comipled-in, syscall itself is in kernel (and is nothing but a wrapper for write()/read()). ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2002-04-04 14:48 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2002-03-30 23:23 linux-2.5.7 Timothy Murphy 2002-03-30 23:41 ` linux-2.5.7 Alexander Viro 2002-03-31 2:22 ` linux-2.5.7 David S. Miller 2002-03-31 7:54 ` linux-2.5.7 Alexander Viro 2002-03-31 8:30 ` linux-2.5.7 Andrew Morton 2002-03-31 8:42 ` linux-2.5.7 Alexander Viro 2002-04-04 9:42 ` linux-2.5.7 Richard Henderson 2002-04-04 14:45 ` linux-2.5.7 Alvaro Figueroa 2002-03-31 3:25 ` linux-2.5.7 Pierre Rousselet 2002-03-31 6:21 ` linux-2.5.7 David S. Miller -- strict thread matches above, loose matches on Subject: below -- 2002-03-30 23:48 linux-2.5.7 Neil Brown 2002-03-31 0:02 ` linux-2.5.7 Keith Owens 2002-03-31 2:04 ` linux-2.5.7 Alexander Viro
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox