The second version of this patch with Linus' comments addressed. I've changed the code for a few architectures to use a new name (<arch>_pipe instead of sys_pipe) as per Linus' suggestion. I haven't touched MIPS and Sparc, they use too much magic in this area. Should be easy enough for the arch maintainer to clean up. sys_pipe is now unconditionally created in fs/pipe.c and they will lead to link errors in case the arch code isn't cleaned up. Some arch maintainers might want to take a look at their remaining special versions. The cris version, for instance, only differs from the generic version in that it takes the BKL. Is this still needed these days? arch/alpha/kernel/entry.S | 8 ++++---- arch/alpha/kernel/systbls.S | 2 +- arch/arm/kernel/sys_arm.c | 17 ----------------- arch/avr32/kernel/sys_avr32.c | 13 ------------- arch/blackfin/kernel/sys_bfin.c | 17 ----------------- arch/cris/arch-v10/kernel/entry.S | 2 +- arch/cris/arch-v32/kernel/entry.S | 2 +- arch/cris/kernel/sys_cris.c | 4 ++-- arch/frv/kernel/sys_frv.c | 17 ----------------- arch/h8300/kernel/sys_h8300.c | 17 ----------------- arch/ia64/kernel/entry.S | 2 +- arch/ia64/kernel/sys_ia64.c | 2 +- arch/m32r/kernel/sys_m32r.c | 4 ++-- arch/m32r/kernel/syscall_table.S | 2 +- arch/m68k/kernel/sys_m68k.c | 17 ----------------- arch/m68knommu/kernel/sys_m68k.c | 17 ----------------- arch/mn10300/kernel/sys_mn10300.c | 17 ----------------- arch/parisc/kernel/sys_parisc.c | 13 ------------- arch/powerpc/kernel/syscalls.c | 17 ----------------- arch/s390/kernel/entry.h | 1 - arch/s390/kernel/sys_s390.c | 17 ----------------- arch/sh/kernel/sys_sh32.c | 4 ++-- arch/sh/kernel/sys_sh64.c | 17 ----------------- arch/sh/kernel/syscalls_32.S | 2 +- arch/um/kernel/syscall.c | 17 ----------------- arch/v850...
On Sat, May 3, 2008 at 8:01 PM, Ulrich Drepper <drepper@redhat.com> wrote: [...] I realize this code is old, but wouldn't file descriptors leak if copy_to_user fails? BR, dm.n9107 --
The MIPS implementation doesn't have this problem; it returns the file descriptors in the result registers $v0 and $v1. But an interesting catch after so many years! Ralf --
Yes, it does -- I just tested this. -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html --
No, definitely not. That said, I think that in order to not break other architectures, and to make it even easier to do this transformation, how about we just mark the generic version with __weak? That way, odd architectures can just continue to call their own versions "sys_pipe()", and we don't break them unnecessarily. Linus --
| Andrea Arcangeli | [PATCH 06 of 11] rwsem contended |
| Mikulas Patocka | LFENCE instruction (was: [rfc][patch 3/3] x86: optimise barriers) |
| Rafael J. Wysocki | Re: [Bug 10030] Suspend doesn't work when SD card is inserted |
| Manu Abraham | PCIE |
git: | |
| Sverre Rabbelier | Git vs Monotone |
| Junio C Hamano | [ANNOUNCE] GIT 1.5.4 |
| Bill Lear | Meaning of "fatal: protocol error: bad line length character"? |
| Junio C Hamano | Re: [PATCH] Teach remote machinery about remotes.default config variable |
| Richard Stallman | Real men don't attack straw men |
| Stefan Beke | mail dovecot: pipe() failed: Too many open files |
| Wijnand Wiersma | Almost success: OpenBSD on Xen |
| Didier Wiroth | how can I "find xyz | xargs tar" ... like gtar |
| Greg A. Woods | Re: Fork bomb protection patch |
| Tyler Retzlaff | Re: more summer of code fun |
| Elad Efrat | Re: sysctl knob to let sugid processes dump core (pr 15994) |
| Thor Lancelot Simon | Re: FFS journal |
