* [PATCH] change compat shmget size arg to signed
@ 2006-02-20 18:39 Olaf Hering
0 siblings, 0 replies; 5+ messages in thread
From: Olaf Hering @ 2006-02-20 18:39 UTC (permalink / raw)
To: linuxppc-dev
change second arg (the 'size') to signed to handle a size of -1.
ltp test shmget02 fails. This patch fixes it.
Oddly, we see the failure only on a POWER4 LPAR with 4.6G ram.
Signed-off-by: Olaf Hering <olh@suse.de>
arch/powerpc/kernel/sys_ppc32.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.16-rc4-olh/arch/powerpc/kernel/sys_ppc32.c
===================================================================
--- linux-2.6.16-rc4-olh.orig/arch/powerpc/kernel/sys_ppc32.c
+++ linux-2.6.16-rc4-olh/arch/powerpc/kernel/sys_ppc32.c
@@ -429,7 +429,7 @@ long compat_sys_ipc(u32 call, u32 first,
return sys_shmdt(compat_ptr(ptr));
case SHMGET:
/* sign extend key_t */
- return sys_shmget((int)first, second, third);
+ return sys_shmget((int)first, (int)second, third);
case SHMCTL:
/* sign extend shmid */
return compat_sys_shmctl((int)first, second, compat_ptr(ptr));
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] change compat shmget size arg to signed
@ 2006-02-23 23:16 Stephen Rothwell
2006-02-23 23:27 ` Olaf Hering
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2006-02-23 23:16 UTC (permalink / raw)
To: Olaf Herring; +Cc: ppc64-dev, ppc-dev
Hi Olaf,
> change second arg (the 'size') to signed to handle a size of -1.
> ltp test shmget02 fails. This patch fixes it.
> Oddly, we see the failure only on a POWER4 LPAR with 4.6G ram.
>
> Signed-off-by: Olaf Hering <olh at suse.de>
>
> arch/powerpc/kernel/sys_ppc32.c | 2 +-
> 1 files changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6.16-rc4-olh/arch/powerpc/kernel/sys_ppc32.c
> ===================================================================
> --- linux-2.6.16-rc4-olh.orig/arch/powerpc/kernel/sys_ppc32.c
> +++ linux-2.6.16-rc4-olh/arch/powerpc/kernel/sys_ppc32.c
> @@ -429,7 +429,7 @@ long compat_sys_ipc(u32 call, u32 first,
> return sys_shmdt(compat_ptr(ptr));
> case SHMGET:
> /* sign extend key_t */
> - return sys_shmget((int)first, second, third);
> + return sys_shmget((int)first, (int)second, third);
> case SHMCTL:
> /* sign extend shmid */
> return compat_sys_shmctl((int)first, second, compat_ptr(ptr));
Does the ltp test fail on a standard kernel(where SHMMAX is 0x2000000), or
only on a SLES kernel (where SHMMAX is ULONG_MAX)?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] change compat shmget size arg to signed
2006-02-23 23:16 Stephen Rothwell
@ 2006-02-23 23:27 ` Olaf Hering
2006-02-24 0:12 ` Stephen Rothwell
0 siblings, 1 reply; 5+ messages in thread
From: Olaf Hering @ 2006-02-23 23:27 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: ppc64-dev, ppc-dev
On Fri, Feb 24, Stephen Rothwell wrote:
> Does the ltp test fail on a standard kernel(where SHMMAX is 0x2000000), or
> only on a SLES kernel (where SHMMAX is ULONG_MAX)?
It fails with SLES9 and SLES10. SLES9 has 0x2000000 as default.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] change compat shmget size arg to signed
2006-02-23 23:27 ` Olaf Hering
@ 2006-02-24 0:12 ` Stephen Rothwell
2006-03-06 19:38 ` Olaf Hering
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2006-02-24 0:12 UTC (permalink / raw)
To: Olaf Hering; +Cc: linuxppc64-dev, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 689 bytes --]
On Fri, 24 Feb 2006 00:27:17 +0100 Olaf Hering <olh@suse.de> wrote:
>
> On Fri, Feb 24, Stephen Rothwell wrote:
>
> > Does the ltp test fail on a standard kernel(where SHMMAX is 0x2000000), or
> > only on a SLES kernel (where SHMMAX is ULONG_MAX)?
>
> It fails with SLES9 and SLES10. SLES9 has 0x2000000 as default.
So what was shm_ctlmax set to when the test was run.
I am trying to figure out why this test:
if (size < SHMMIN || size > shm_ctlmax)
return -EINVAL;
Doesn't return -EINVAL for size == 0xffffffff if shm_ctlmax is 0x2000000?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] change compat shmget size arg to signed
2006-02-24 0:12 ` Stephen Rothwell
@ 2006-03-06 19:38 ` Olaf Hering
0 siblings, 0 replies; 5+ messages in thread
From: Olaf Hering @ 2006-03-06 19:38 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc64-dev, linuxppc-dev
On Fri, Feb 24, Stephen Rothwell wrote:
> On Fri, 24 Feb 2006 00:27:17 +0100 Olaf Hering <olh@suse.de> wrote:
> >
> > On Fri, Feb 24, Stephen Rothwell wrote:
> >
> > > Does the ltp test fail on a standard kernel(where SHMMAX is 0x2000000), or
> > > only on a SLES kernel (where SHMMAX is ULONG_MAX)?
> >
> > It fails with SLES9 and SLES10. SLES9 has 0x2000000 as default.
>
> So what was shm_ctlmax set to when the test was run.
>
> I am trying to figure out why this test:
>
> if (size < SHMMIN || size > shm_ctlmax)
> return -EINVAL;
>
> Doesn't return -EINVAL for size == 0xffffffff if shm_ctlmax is 0x2000000?
shm_ctlmax is a sysctrl, so it can have anything. The ltp test is
invalid. shmget02 dos not fail after:
echo $(( 0x2000000 )) > /proc/sys/kernel/shmmax
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-03-06 19:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-20 18:39 [PATCH] change compat shmget size arg to signed Olaf Hering
-- strict thread matches above, loose matches on Subject: below --
2006-02-23 23:16 Stephen Rothwell
2006-02-23 23:27 ` Olaf Hering
2006-02-24 0:12 ` Stephen Rothwell
2006-03-06 19:38 ` Olaf Hering
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).