[uml-devel] [PATCH 03/11] uml - hostfs: make hostfs= option work as a jail, as intended.

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

When a given host directory is specified to be mounted both in hostfs=path1 and
with mount option -o path2, we should give access to path1/path2, but this does
not happen. Fix that in the simpler way.

Also, root_ino can be the empty string, since we use %s/%s as format.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 fs/hostfs/hostfs_kern.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 6f10e43..9baf697 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -47,7 +47,7 @@ struct dentry_operations hostfs_dentry_ops = {
 };
 
 /* Changed in hostfs_args before the kernel starts running */
-static char *root_ino = /;
+static char *root_ino = ;
 static int append = 0;
 
 #define HOSTFS_SUPER_MAGIC 0x00c0ffee
@@ -947,15 +947,17 @@ static int hostfs_fill_sb_common(struct super_block *sb, 
void *d, int silent)
sb-s_magic = HOSTFS_SUPER_MAGIC;
sb-s_op = hostfs_sbops;
 
-   if((data == NULL) || (*data == '\0'))
-   data = root_ino;
+   /* NULL is printed as NULL by sprintf: avoid that. */
+   if (data == NULL)
+   data = ;
 
err = -ENOMEM;
-   name = kmalloc(strlen(data) + 1, GFP_KERNEL);
+   name = kmalloc(strlen(root_ino) + 1
+   + strlen(data) + 1, GFP_KERNEL);
if(name == NULL)
goto out;
 
-   strcpy(name, data);
+   sprintf(name, %s/%s, root_ino, data);
 
root_inode = iget(sb, 0);
if(root_inode == NULL)



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 08/11] uml: mark both consoles as CON_ANYTIME

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

Since both UML consoles do not use percpu variables, they may be called when the
cpu is still offline, and they may be marked CON_ANYTIME (this is documented in
kernel/printk.c, grep for CON_ANYTIME to find mentions of this).

Works well in testing done with lock debug enabled, should be safe but is
not needed for next release.

This would probably help also stderr_console.c, but this is yet to test.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 arch/um/drivers/ssl.c   |2 +-
 arch/um/drivers/stdio_console.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c
index fc22b9b..4b382a6 100644
--- a/arch/um/drivers/ssl.c
+++ b/arch/um/drivers/ssl.c
@@ -179,7 +179,7 @@ static struct console ssl_cons = {
.write  = ssl_console_write,
.device = ssl_console_device,
.setup  = ssl_console_setup,
-   .flags  = CON_PRINTBUFFER,
+   .flags  = CON_PRINTBUFFER|CON_ANYTIME,
.index  = -1,
 };
 
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
index 7ff0b0f..76d1f1c 100644
--- a/arch/um/drivers/stdio_console.c
+++ b/arch/um/drivers/stdio_console.c
@@ -153,7 +153,7 @@ static struct console stdiocons = {
.write  = uml_console_write,
.device = uml_console_device,
.setup  = uml_console_setup,
-   .flags  = CON_PRINTBUFFER,
+   .flags  = CON_PRINTBUFFER|CON_ANYTIME,
.index  = -1,
 };
 



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 05/11] hostfs: rename some vars for clarity

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

* rename name to host_root_path
* rename data to req_root.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 fs/hostfs/hostfs_kern.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 0bcf7ac..b4e127b 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -961,7 +961,7 @@ static int contains_dotdot(const char* path)
 static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
 {
struct inode *root_inode;
-   char *name, *data = d;
+   char *host_root_path, *req_root = d;
int err;
 
sb-s_blocksize = 1024;
@@ -970,20 +970,20 @@ static int hostfs_fill_sb_common(struct super_block *sb, 
void *d, int silent)
sb-s_op = hostfs_sbops;
 
/* NULL is printed as NULL by sprintf: avoid that. */
-   if (data == NULL)
-   data = ;
+   if (req_root == NULL)
+   req_root = ;
 
err = -EINVAL;
-   if (unlikely(contains_dotdot(data)))
+   if (unlikely(contains_dotdot(req_root)))
goto out;
 
err = -ENOMEM;
-   name = kmalloc(strlen(root_ino) + 1
-   + strlen(data) + 1, GFP_KERNEL);
-   if(name == NULL)
+   host_root_path = kmalloc(strlen(root_ino) + 1
+   + strlen(req_root) + 1, GFP_KERNEL);
+   if(host_root_path == NULL)
goto out;
 
-   sprintf(name, %s/%s, root_ino, data);
+   sprintf(host_root_path, %s/%s, root_ino, req_root);
 
root_inode = iget(sb, 0);
if(root_inode == NULL)
@@ -993,10 +993,10 @@ static int hostfs_fill_sb_common(struct super_block *sb, 
void *d, int silent)
if(err)
goto out_put;
 
-   HOSTFS_I(root_inode)-host_filename = name;
-   /* Avoid that in the error path, iput(root_inode) frees again name 
through
-* hostfs_destroy_inode! */
-   name = NULL;
+   HOSTFS_I(root_inode)-host_filename = host_root_path;
+   /* Avoid that in the error path, iput(root_inode) frees again
+* host_root_path through hostfs_destroy_inode! */
+   host_root_path = NULL;
 
err = -ENOMEM;
sb-s_root = d_alloc_root(root_inode);
@@ -1016,7 +1016,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, 
void *d, int silent)
  out_put:
 iput(root_inode);
  out_free:
-   kfree(name);
+   kfree(host_root_path);
  out:
return(err);
 }


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 09/11] uml: fix confusion irq early reenabling

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

Fix confusion about call context - comments and code are inconsistent and plain
wrong, my fault.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 arch/um/drivers/line.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 01d4ab6..f75d7b0 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -370,10 +370,10 @@ static irqreturn_t line_write_interrupt(int irq, void 
*data)
struct tty_struct *tty = line-tty;
int err;
 
-   /* Interrupts are enabled here because we registered the interrupt with
+   /* Interrupts are disabled here because we registered the interrupt with
 * IRQF_DISABLED (see line_setup_irq).*/
 
-   spin_lock_irq(line-lock);
+   spin_lock(line-lock);
err = flush_buffer(line);
if (err == 0) {
return IRQ_NONE;
@@ -381,7 +381,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data)
line-head = line-buffer;
line-tail = line-buffer;
}
-   spin_unlock_irq(line-lock);
+   spin_unlock(line-lock);
 
if(tty == NULL)
return IRQ_NONE;



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 02/11] uml - hostfs: fix double free

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

Fix double free in the error path - when name is assigned into root_inode we do
not own it any more and we must not kfree() it - see patch for details.

Thanks to William Stearns for the initial report.

CC: William Stearns [EMAIL PROTECTED]
Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 fs/hostfs/hostfs_kern.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index e965eb1..6f10e43 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -966,6 +966,9 @@ static int hostfs_fill_sb_common(struct super_block *sb, 
void *d, int silent)
goto out_put;
 
HOSTFS_I(root_inode)-host_filename = name;
+   /* Avoid that in the error path, iput(root_inode) frees again name 
through
+* hostfs_destroy_inode! */
+   name = NULL;
 
err = -ENOMEM;
sb-s_root = d_alloc_root(root_inode);
@@ -977,7 +980,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, 
void *d, int silent)
 /* No iput in this case because the dput does that for us */
 dput(sb-s_root);
 sb-s_root = NULL;
-   goto out_free;
+   goto out;
 }
 
return(0);



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 06/11] uml: fix a memory leak in the multicast driver

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

Memory allocated by mcast_user_init must be freed in the matching mcast_remove.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 arch/um/drivers/mcast_user.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c
index 8138f5e..b827e82 100644
--- a/arch/um/drivers/mcast_user.c
+++ b/arch/um/drivers/mcast_user.c
@@ -50,6 +50,14 @@ static void mcast_user_init(void *data, void *dev)
pri-dev = dev;
 }
 
+static void mcast_remove(void *data)
+{
+   struct mcast_data *pri = data;
+
+   kfree(pri-mcast_addr);
+   pri-mcast_addr = NULL;
+}
+
 static int mcast_open(void *data)
 {
struct mcast_data *pri = data;
@@ -157,7 +165,7 @@ const struct net_user_info mcast_user_info = {
.init   = mcast_user_init,
.open   = mcast_open,
.close  = mcast_close,
-   .remove = NULL,
+   .remove = mcast_remove,
.set_mtu= mcast_set_mtu,
.add_address= NULL,
.delete_address = NULL,


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 10/11] uml - activate_fd: return ENOMEM only when appropriate

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

Avoid returning ENOMEM in case of a duplicate IRQ - ENOMEM was saved into err
earlier.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 arch/um/kernel/irq.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 50a288b..dbf2f5b 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -142,6 +142,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
 .events= events,
 .current_events= 0 } );
 
+   err = -EBUSY;
spin_lock_irqsave(irq_lock, flags);
for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd-next) {
if ((irq_fd-fd == fd)  (irq_fd-type == type)) {



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 07/11] uml: remove dead code about os_usr1_signal() and os_usr1_process()

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

os_usr1_signal() is totally unused, os_usr1_process() is used only by TT mode.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 arch/um/include/os.h   |3 ++-
 arch/um/os-Linux/process.c |3 +++
 arch/um/os-Linux/signal.c  |5 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/um/include/os.h b/arch/um/include/os.h
index 8629bd1..5c74da4 100644
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@ -192,7 +192,9 @@ extern int os_process_parent(int pid);
 extern void os_stop_process(int pid);
 extern void os_kill_process(int pid, int reap_child);
 extern void os_kill_ptraced_process(int pid, int reap_child);
+#ifdef UML_CONFIG_MODE_TT
 extern void os_usr1_process(int pid);
+#endif
 extern long os_ptrace_ldt(long pid, long addr, long data);
 
 extern int os_getpid(void);
@@ -261,7 +263,6 @@ extern void block_signals(void);
 extern void unblock_signals(void);
 extern int get_signals(void);
 extern int set_signals(int enable);
-extern void os_usr1_signal(int on);
 
 /* trap.c */
 extern void os_fill_handlinfo(struct kern_handlers h);
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index c692a19..76bdd67 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -21,6 +21,7 @@
 #include longjmp.h
 #include skas_ptrace.h
 #include kern_constants.h
+#include uml-config.h
 
 #define ARBITRARY_ADDR -1
 #define FAILURE_PID-1
@@ -131,10 +132,12 @@ void os_kill_ptraced_process(int pid, int reap_child)
CATCH_EINTR(waitpid(pid, NULL, 0));
 }
 
+#ifdef UML_CONFIG_MODE_TT
 void os_usr1_process(int pid)
 {
kill(pid, SIGUSR1);
 }
+#endif
 
 /* Don't use the glibc version, which caches the result in TLS. It misses some
  * syscalls, and also breaks with clone(), which does not unshare the TLS.
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index b897e85..2667686 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -243,8 +243,3 @@ int set_signals(int enable)
 
return ret;
 }
-
-void os_usr1_signal(int on)
-{
-   change_sig(SIGUSR1, on);
-}


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 11/11] uml: fix errno usage

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

Avoid reusing userspace errno twice - it can be cleared by libc code everywhere
(in particular printk() does clear it in my setup).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 arch/um/drivers/daemon_user.c |   17 +
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c
index 310af0f..021b82c 100644
--- a/arch/um/drivers/daemon_user.c
+++ b/arch/um/drivers/daemon_user.c
@@ -56,30 +56,31 @@ static int connect_to_switch(struct daemon_data *pri)
 
pri-control = socket(AF_UNIX, SOCK_STREAM, 0);
if(pri-control  0){
+   err = -errno;
printk(daemon_open : control socket failed, errno = %d\n, 
-  errno);  
-   return(-errno);
+  -err);
+   return err;
}
 
if(connect(pri-control, (struct sockaddr *) ctl_addr, 
   sizeof(*ctl_addr))  0){
-   printk(daemon_open : control connect failed, errno = %d\n,
-  errno);
err = -errno;
+   printk(daemon_open : control connect failed, errno = %d\n,
+  -err);
goto out;
}
 
fd = socket(AF_UNIX, SOCK_DGRAM, 0);
if(fd  0){
-   printk(daemon_open : data socket failed, errno = %d\n, 
-  errno);
err = -errno;
+   printk(daemon_open : data socket failed, errno = %d\n,
+  -err);
goto out;
}
if(bind(fd, (struct sockaddr *) local_addr, sizeof(*local_addr))  0){
-   printk(daemon_open : data bind failed, errno = %d\n, 
-  errno);
err = -errno;
+   printk(daemon_open : data bind failed, errno = %d\n,
+  -err);
goto out_close;
}
 


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] [PATCH 1/2] uml: make sigio_lock() irq-safe

2007-03-05 Thread Paolo 'Blaisorblade' Giarrusso
From: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]

sigio_lock is taken both from process context and from interrupt context. So we
*must* use irqsave.

Then, remove irq disabling from update_thread(), as it's called with
sigio_lock() held (yes, set_signals(0) is local_irq_save).

In fact, I've seen this causing frequent hangs with spinlock debugging enabled
(I've verified well that the cause was an interrupt causing re-acquiring of
this lock); however, now it's causing hangs as interrupt disabling causes
some sleep-inside-spinlock checks to trigger - and then printk deadlocks.

I've tested this for a long time and it is stable.
I've also verified that nothing can sleep within this lock; to this purpose,
I've had to verify everything inside um_request_irq; since it calls again
write_sigio_workaround(), I've had to make atomic the allocation inside
setup_initial_poll.

HOWEVER, request_irq() can sleep, and in write_sigio_irq() thanks to
IRQF_SAMPLE_RANDOM it _does_ sleep. So a separate patch makes write_sigio_irq()
be called outside of sigio_lock().

Actually, I'm also quite dubious that an interrupt caused by other interrupts is
a reliable entropy source, but that is another thing completely.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 arch/um/include/sigio.h  |4 ++--
 arch/um/kernel/sigio.c   |   12 
 arch/um/os-Linux/sigio.c |   36 
 3 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/arch/um/include/sigio.h b/arch/um/include/sigio.h
index 434f1a9..a58bc1d 100644
--- a/arch/um/include/sigio.h
+++ b/arch/um/include/sigio.h
@@ -8,7 +8,7 @@
 
 extern int write_sigio_irq(int fd);
 extern int register_sigio_fd(int fd);
-extern void sigio_lock(void);
-extern void sigio_unlock(void);
+extern unsigned long sigio_lock(void);
+extern void sigio_unlock(unsigned long flags);
 
 #endif
diff --git a/arch/um/kernel/sigio.c b/arch/um/kernel/sigio.c
index 89f9866..cc54db7 100644
--- a/arch/um/kernel/sigio.c
+++ b/arch/um/kernel/sigio.c
@@ -45,12 +45,16 @@ int write_sigio_irq(int fd)
 /* These are called from os-Linux/sigio.c to protect its pollfds arrays. */
 static DEFINE_SPINLOCK(sigio_spinlock);
 
-void sigio_lock(void)
+unsigned long sigio_lock(void)
 {
-   spin_lock(sigio_spinlock);
+   unsigned long flags;
+
+   spin_lock_irqsave(sigio_spinlock, flags);
+
+   return flags;
 }
 
-void sigio_unlock(void)
+void sigio_unlock(unsigned long flags)
 {
-   spin_unlock(sigio_spinlock);
+   spin_unlock_irqrestore(sigio_spinlock, flags);
 }
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index 3fc43b3..88988fb 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -21,6 +21,10 @@
 #include os.h
 #include um_malloc.h
 
+/* Nothing in this file can sleep. I've verified each and every function. The
+ * only exception is write_sigio_thread, which runs in a host thread, so it
+ * has no chance of sleeping. */
+
 /* Protected by sigio_lock(), also used by sigio_cleanup, which is an
  * exitcall.
  */
@@ -121,11 +125,9 @@ static int need_poll(struct pollfds *polls, int n)
  */
 static void update_thread(void)
 {
-   unsigned long flags;
int n;
char c;
 
-   flags = set_signals(0);
n = os_write_file(sigio_private[0], c, sizeof(c));
if(n != sizeof(c)){
printk(update_thread : write failed, err = %d\n, -n);
@@ -138,7 +140,6 @@ static void update_thread(void)
goto fail;
}
 
-   set_signals(flags);
return;
  fail:
/* Critical section start */
@@ -150,15 +151,15 @@ static void update_thread(void)
close(write_sigio_fds[0]);
close(write_sigio_fds[1]);
/* Critical section end */
-   set_signals(flags);
 }
 
 int add_sigio_fd(int fd)
 {
struct pollfd *p;
int err = 0, i, n;
+   unsigned long flags;
 
-   sigio_lock();
+   flags = sigio_lock();
for(i = 0; i  all_sigio_fds.used; i++){
if(all_sigio_fds.poll[i].fd == fd)
break;
@@ -184,7 +185,7 @@ int add_sigio_fd(int fd)
next_poll.used = n + 1;
update_thread();
  out:
-   sigio_unlock();
+   sigio_unlock(flags);
return err;
 }
 
@@ -192,6 +193,7 @@ int ignore_sigio_fd(int fd)
 {
struct pollfd *p;
int err = 0, i, n = 0;
+   unsigned long flags;
 
/* This is called from exitcalls elsewhere in UML - if
 * sigio_cleanup has already run, then update_thread will hang
@@ -200,7 +202,7 @@ int ignore_sigio_fd(int fd)
if(write_sigio_pid == -1)
return -EIO;
 
-   sigio_lock();
+   flags = sigio_lock();
for(i = 0; i  current_poll.used; i++){
if(current_poll.poll[i].fd == fd) break;
}
@@ -220,7 +222,7 @@ int ignore_sigio_fd(int fd)
 
update_thread();
  out:
-   sigio_unlock();
+   sigio_unlock(flags

[uml-devel] [PATCH] [PATCH] uml: fix static linking for real

2007-03-30 Thread Paolo 'Blaisorblade' Giarrusso
There was a typo in commit 7632fc8f809a97f9d82ce125e8e3e579390ce2e5, preventing
it from working - 32bit binaries crashed hopelessly before the below fix and
work perfectly now.
Merge for 2.6.21, please.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED]
---

 include/asm-um/common.lds.S |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S
index b16222b..f5de80c 100644
--- a/include/asm-um/common.lds.S
+++ b/include/asm-um/common.lds.S
@@ -15,7 +15,7 @@
   PROVIDE (_unprotected_end = .);
 
   . = ALIGN(4096);
-  .note : { *(note.*) }
+  .note : { *(.note.*) }
   __start___ex_table = .;
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;




-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


<    5   6   7   8   9   10