Re: [PATCH v2] unify sys_pipe implementation

Previous thread: s390 kvm_virtio.c build error by Adrian Bunk on Saturday, May 3, 2008 - 1:47 pm. (8 messages)

Next thread: Need help debugging memory corruption by Jay Cliburn on Saturday, May 3, 2008 - 2:09 pm. (8 messages)
To: <linux-kernel@...>
Cc: <akpm@...>, <linux-mips@...>, <sparclinux@...>, <torvalds@...>
Date: Saturday, May 3, 2008 - 2:01 pm

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...

To: Ulrich Drepper <drepper@...>
Cc: <linux-kernel@...>, <akpm@...>, <linux-mips@...>, <sparclinux@...>, <torvalds@...>
Date: Monday, May 5, 2008 - 4:30 am

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
--

To: DM <dm.n9107@...>
Cc: Ulrich Drepper <drepper@...>, <linux-kernel@...>, <akpm@...>, <linux-mips@...>, <sparclinux@...>, <torvalds@...>
Date: Monday, May 5, 2008 - 6:18 am

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
--

To: DM <dm.n9107@...>
Cc: Ulrich Drepper <drepper@...>, <linux-kernel@...>, <akpm@...>, <linux-mips@...>, <sparclinux@...>, <torvalds@...>
Date: Monday, May 5, 2008 - 5:15 am

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
--

To: Ulrich Drepper <drepper@...>
Cc: <linux-kernel@...>, <akpm@...>, <linux-mips@...>, <sparclinux@...>
Date: Saturday, May 3, 2008 - 2:40 pm

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
--

Previous thread: s390 kvm_virtio.c build error by Adrian Bunk on Saturday, May 3, 2008 - 1:47 pm. (8 messages)

Next thread: Need help debugging memory corruption by Jay Cliburn on Saturday, May 3, 2008 - 2:09 pm. (8 messages)