public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@caldera.de>
To: linux-kernel@vger.kernel.org
Subject: Suspicious shifting of sempid in try_atomic_semop()
Date: Wed, 27 Feb 2002 19:17:09 +0100	[thread overview]
Message-ID: <20020227191709.A8247@caldera.de> (raw)

In ipc/sem.c:try_atomic_semop() there is the following code:

	for (sop = sops; sop < sops + nsops; sop++) {
		...
		curr->sempid = (curr->sempid << 16) | pid;
		....
	}

it's undone in the error case:

	while (sop >= sops) {
		...
		curr->sempid >>= 16;
		...
	}

the problem is that in some cases we seem to end up with a sempid
of zero which leads to wrong returns of semctl(..., GETPID, ...)
like in

	http://www.freestandards.org/lsb/test/results/index.php?testcaseid=732

Is there a specific reason we use this shift method I have missed?

	Christoph

-- 
Of course it doesn't work. We've performed a software upgrade.

                 reply	other threads:[~2002-02-27 18:18 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=20020227191709.A8247@caldera.de \
    --to=hch@caldera.de \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox