public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: patch for errno-issue (with soundcore)
@ 2003-01-13 16:33 Petr Vandrovec
  2003-01-13 17:10 ` Thomas Schlichter
  0 siblings, 1 reply; 7+ messages in thread
From: Petr Vandrovec @ 2003-01-13 16:33 UTC (permalink / raw)
  To: Thomas Schlichter; +Cc: Linux Kernel Mailing List, alan

On 13 Jan 03 at 15:57, Thomas Schlichter wrote:
> On Mon, 13. Jan. 2003 16:13, Alan Cox wrote:
> > This actually shows a bug that has always been lurking. What if we load two
> > modules firmware at the same time. errno needs to be task private or we
> > perhaps need an errno_sem ?
> 
> OK, I think I see the problem now!
> But is soundcore the only place where 'errno' is used? Does this problem not 
> occur if any task modifies the errno value and an other one depends on its 
> previous value? I think this could happen even if no modules are used...

There is no problem currently, because of nobody uses errno value at
all (in the firmware loader), it is just that inline functions generated 
by syscallX() store error codes into errno...

Real problem is that firmware loader should use 
filp_open/vfs_read/filp_close (or sys_open/sys_llseek/sys_read/sys_close if 
you want to use fd interface, but filp_{open,close} and vfs_read are already 
exported for modules while sys_open/sys_llseek/sys_read are not).

As an alternative, do_mod_firmware_load should be standalone userspace
program executed through call_usermodehelper or something like that... 
Unfortunately we do not have an interface to distribute userspace binaries 
together with kernel (except initrd) yet, so it would require either
adding do_mod_firmware_load into module-init-tools, or some simillar
package required by 2.[56].x kernels.

Also adding "#define errno (current()->exit_code)" at the beginning of
sound_firmware.c (just below #define __KERNEL_SYSCALLS__) should do
the trick, but I do not recommend taking this path.
                                            Best regards,
                                                Petr Vandrovec
                                                vandrove@vc.cvut.cz
                                                

^ permalink raw reply	[flat|nested] 7+ messages in thread
* patch for errno-issue (with soundcore)
@ 2003-01-13 13:57 Thomas Schlichter
  2003-01-13 14:04 ` Bob_Tracy(0000)
  2003-01-13 15:13 ` Alan Cox
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Schlichter @ 2003-01-13 13:57 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

Hi,

here is a simple patch to export the errno-symbol from the /lib/errno.c file. 
This solves the problem with the soundcore module and works perfectly for 
me...

   Thomas Schlichter

P.S.: This patch is made against the 2.5.56 tree


[-- Attachment #2: errno_patch.diff --]
[-- Type: text/x-diff, Size: 841 bytes --]

diff -urP linux-2.5.56/lib/Makefile linux-2.5.56_patched/lib/Makefile
--- linux-2.5.56/lib/Makefile	Fri Jan 10 21:11:20 2003
+++ linux-2.5.56_patched/lib/Makefile	Mon Jan 13 13:15:41 2003
@@ -9,7 +9,7 @@
 L_TARGET := lib.a

 export-objs := cmdline.o dec_and_lock.o rwsem-spinlock.o rwsem.o \
-	       crc32.o rbtree.o radix-tree.o kobject.o
+	       crc32.o rbtree.o radix-tree.o kobject.o errno.o

 obj-y := errno.o ctype.o string.o vsprintf.o brlock.o cmdline.o \
 	 bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
diff -urP linux-2.5.56/lib/errno.c linux-2.5.56_patched/lib/errno.c
--- linux-2.5.56/lib/errno.c	Fri Jan 10 21:11:40 2003
+++ linux-2.5.56_patched/lib/errno.c	Mon Jan 13 13:17:21 2003
@@ -4,4 +4,8 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */

+#include <linux/module.h>
+
 int errno;
+
+EXPORT_SYMBOL(errno);

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-01-13 19:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-13 16:33 patch for errno-issue (with soundcore) Petr Vandrovec
2003-01-13 17:10 ` Thomas Schlichter
2003-01-13 19:10   ` [PATCH] " Petr Vandrovec
  -- strict thread matches above, loose matches on Subject: below --
2003-01-13 13:57 Thomas Schlichter
2003-01-13 14:04 ` Bob_Tracy(0000)
2003-01-13 15:13 ` Alan Cox
2003-01-13 14:57   ` Thomas Schlichter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox