public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: fix semtimedop syscall
@ 2008-08-27 11:16 Yoshihiro Shimoda
  2008-08-28  6:32 ` Paul Mundt
  2008-08-28  6:41 ` Paul Mundt
  0 siblings, 2 replies; 3+ messages in thread
From: Yoshihiro Shimoda @ 2008-08-27 11:16 UTC (permalink / raw)
  To: linux-sh

fix the problem that cannot work semtimedop system call.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
---

 I think that SPARC has the similar bug.
 However I cannot confirm it, because I don't have SPARC system.

 arch/sh/kernel/sys_sh.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
index 59cd285..9061b86 100644
--- a/arch/sh/kernel/sys_sh.c
+++ b/arch/sh/kernel/sys_sh.c
@@ -170,7 +170,7 @@ asmlinkage int sys_ipc(uint call, int first, int second,
 	version = call >> 16; /* hack for backward compatibility */
 	call &= 0xffff;

-	if (call <= SEMCTL)
+	if (call <= SEMTIMEDOP)
 		switch (call) {
 		case SEMOP:
 			return sys_semtimedop(first,
-- 
1.5.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sh: fix semtimedop syscall
  2008-08-27 11:16 [PATCH] sh: fix semtimedop syscall Yoshihiro Shimoda
@ 2008-08-28  6:32 ` Paul Mundt
  2008-08-28  6:41 ` Paul Mundt
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2008-08-28  6:32 UTC (permalink / raw)
  To: linux-sh

On Wed, Aug 27, 2008 at 08:16:46PM +0900, Yoshihiro Shimoda wrote:
> fix the problem that cannot work semtimedop system call.
> 
> Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
> ---
> 
>  I think that SPARC has the similar bug.
>  However I cannot confirm it, because I don't have SPARC system.
> 
>  arch/sh/kernel/sys_sh.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
> index 59cd285..9061b86 100644
> --- a/arch/sh/kernel/sys_sh.c
> +++ b/arch/sh/kernel/sys_sh.c
> @@ -170,7 +170,7 @@ asmlinkage int sys_ipc(uint call, int first, int second,
>  	version = call >> 16; /* hack for backward compatibility */
>  	call &= 0xffff;
> 
> -	if (call <= SEMCTL)
> +	if (call <= SEMTIMEDOP)
>  		switch (call) {
>  		case SEMOP:
>  			return sys_semtimedop(first,

Good catch! This has been broken for a long time, at least it predates
git history.  At first glance, sh, sparc, and sparc64 have a
sys_semtimedop() reference that will never be invoked, while other
platforms (h8300, m68k, and m68knommu) don't implement it at all and
simply -ENOSYS (or -EINVAL) out.

Since these nommu platforms haven't supported semtimedop() since its
introduction in 2.5.52, they may want to think about hooking it up at
some point. Both glibc and uClibc support it today.

sparc64's compat_sys_ipc() does the right thing while the built-in
sys_ipc() has the same bug you've noted. So, here are the sparc/sparc64
bits.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

---

 arch/sparc/kernel/sys_sparc.c   |    2 +-
 arch/sparc64/kernel/sys_sparc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 4d73421..af653a1 100644
--- a/arch/sparc/kernel/sys_sparc.c
+++ b/arch/sparc/kernel/sys_sparc.c
@@ -119,7 +119,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void __user
 	version = call >> 16; /* hack for backward compatibility */
 	call &= 0xffff;
 
-	if (call <= SEMCTL)
+	if (call <= SEMTIMEDOP)
 		switch (call) {
 		case SEMOP:
 			err = sys_semtimedop (first, (struct sembuf __user *)ptr, second, NULL);
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 39749e3..4446730 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -439,7 +439,7 @@ asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
 	long err;
 
 	/* No need for backward compatibility. We can start fresh... */
-	if (call <= SEMCTL) {
+	if (call <= SEMTIMEDOP) {
 		switch (call) {
 		case SEMOP:
 			err = sys_semtimedop(first, ptr,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sh: fix semtimedop syscall
  2008-08-27 11:16 [PATCH] sh: fix semtimedop syscall Yoshihiro Shimoda
  2008-08-28  6:32 ` Paul Mundt
@ 2008-08-28  6:41 ` Paul Mundt
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2008-08-28  6:41 UTC (permalink / raw)
  To: linux-sh

On Wed, Aug 27, 2008 at 08:16:46PM +0900, Yoshihiro Shimoda wrote:
> fix the problem that cannot work semtimedop system call.
> 
> Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-28  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-27 11:16 [PATCH] sh: fix semtimedop syscall Yoshihiro Shimoda
2008-08-28  6:32 ` Paul Mundt
2008-08-28  6:41 ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox