All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH 3/2] Fix locking on interation restart
Date: Sun, 03 Jun 2007 14:04:43 +0200	[thread overview]
Message-ID: <4662AE5B.6090207@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 137 bytes --]

Argh, someone very blind must have contributed this bug - of course /me.

This is also stuff or 2.3 (just like the 1/2 patch).

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: fix-proc-restarts.patch --]
[-- Type: text/x-patch; name="fix-proc-restarts.patch", Size: 1703 bytes --]

---
 ChangeLog             |    3 +++
 ksrc/nucleus/module.c |    7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

Index: xenomai/ChangeLog
===================================================================
--- xenomai.orig/ChangeLog
+++ xenomai/ChangeLog
@@ -9,6 +9,9 @@
 	* ksrc/nucleus/synch.c (xnsynch_sleep_on): Fix timeout restart
 	if resource was robbed.
 
+	* ksrc/nucleus/module.c: Fix locking on restart of sched and stat
+	interation for proc output.
+
 2007-06-02  Philippe Gerum  <rpm@xenomai.org>
 
 	* ksrc/skins/psos+, src/skins/psos+, include/psos+/psos.h: Add
Index: xenomai/ksrc/nucleus/module.c
===================================================================
--- xenomai.orig/ksrc/nucleus/module.c
+++ xenomai/ksrc/nucleus/module.c
@@ -190,9 +190,9 @@ static int sched_seq_open(struct inode *
 	if (!nkpod)
 		return -ESRCH;
 
-      restart:
 	xnlock_get_irqsave(&nklock, s);
 
+      restart:
 	rev = nkpod->threadq_rev;
 	count = countq(&nkpod->threadq);	/* Cannot be empty (ROOT) */
 	holder = getheadq(&nkpod->threadq);
@@ -363,9 +363,10 @@ static int stat_seq_open(struct inode *i
 	if (!nkpod)
 		return -ESRCH;
 
-      restart:
+      restart_unlocked:
 	xnlock_get_irqsave(&nklock, s);
 
+      restart:
 	count = countq(&nkpod->threadq);	/* Cannot be empty (ROOT) */
 	holder = getheadq(&nkpod->threadq);
 	thrq_rev = nkpod->threadq_rev;
@@ -461,7 +462,7 @@ static int stat_seq_open(struct inode *i
 					   &stat_info->runtime,
 					   &stat_info->account_period);
 			if (err == -EAGAIN)
-				goto restart;
+				goto restart_unlocked;
 			if (err)
 				break; /* line unused or end of chain */
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

                 reply	other threads:[~2007-06-03 12:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4662AE5B.6090207@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.