Skip to contentSkip to conversation

char/snsc: reorder set_current_state() and

PATCH Applied Nishanth Aravamudan 2 participants 2 messages Oct 22, 2004 – Oct 24, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 char/snsc: reorder set_current_state() and

Any comments would be, as always, appreciated.

-Nish

Description: Reorder add_wait_queue() and set_current_state() as a signal could be lost in between the two functions.

drivers/char/snsc.c +2 -2
@@ -192,8 +192,8 @@ scdrv_read(struct file *file, char __use
 		}
 
 		len = CHUNKSIZE;
-		add_wait_queue(&sd->sd_rq, &wait);
 		set_current_state(TASK_INTERRUPTIBLE);
+		add_wait_queue(&sd->sd_rq, &wait);
 		spin_unlock_irqrestore(&sd->sd_rlock, flags);
 
 		schedule_timeout(SCDRV_TIMEOUT);
@@ -288,8 +288,8 @@ scdrv_write(struct file *file, const cha
 			return -EAGAIN;
 		}
 
-		add_wait_queue(&sd->sd_wq, &wait);
 		set_current_state(TASK_INTERRUPTIBLE);
+		add_wait_queue(&sd->sd_wq, &wait);
 		spin_unlock_irqrestore(&sd->sd_wlock, flags);
 
 		schedule_timeout(SCDRV_TIMEOUT);

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 8 lines · Nishanth Aravamudan

Any comments would be, as always, appreciated.

-Nish

Description: Reorder add_wait_queue() and set_current_state() as a signal could be lost in between the two functions.

applied to kjt,
to get further testing and to be shure it gets upstream.

thanks

--
maks
kernel janitor http://janitor.kernelnewbies.org/

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors