lkml.org 
[lkml]   [2008]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ATA over Ethernet: Convert emsgs_sema in a completion
On Fri, 16 May 2008 21:11:33 +0200
Matthias Kaehlcke <matthias@kaehlcke.net> wrote:

> @@ -216,7 +217,7 @@ aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off)
>
> spin_unlock_irqrestore(&emsgs_lock, flags);
>
> - n = down_interruptible(&emsgs_sema);
> + n = wait_for_completion_interruptible(&emsgs_comp);

Patch looks OK, but I worry about this code. Suppose a signal is sent
and we return to userspace with the complete() still outstanding. Then
someone removes the module.

Perhaps there is synchronisation code which prevents that crash?


\
 
 \ /
  Last update: 2008-05-20 01:55    [W:0.090 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site