Re: [REGRESSION][PATCH] mqueue: Ignore the validity of abs_timeoutparameter when message can be performed immediately

From: Thomas Gleixner
Date: Wed Mar 14 2012 - 18:08:59 EST


On Wed, 14 Mar 2012, Andrew Morton wrote:

> On Fri, 02 Mar 2012 16:42:35 +0900
> Akira Takeuchi <takeuchi.akr@xxxxxxxxxxxxxxxx> wrote:
>
> > This patch fixes up the regression problem of mq_timed{send,receive} syscall.
> >
> > When a message of mqueue can be performed immediately,
> > the validity of abs_timeout parameter should not be checked.
> >
> > According to the manpage of mq_timedreceive:
> > Under no circumstance shall the operation fail with a timeout
> > if a message can be removed from the message queue immediately.
> > The validity of the abstime parameter need not be checked
> > if a message can be removed from the message queue immediately.

Those POSIX spec folks definitely have a seriously distorted
relationship to timers and timekeeping.

So the caller knows upfront when he needs to provide a valid timespec
and when not. So the users of mq_.... are into crystal ball
programming or what?

> > On 2.6.35+ kernel, mq_timed{send,receive} returns EINVAL incorrectly,
> > in this situation.
> >
> > I found this problem during the OPTS testcase
> > "conformance/interfaces/mq_timedreceive/10-2":
> >
> > # ./10-2.test
> > FAIL: the validity of abs_timeout is checked
> > Test FAILED
>
> Are you able to identify the commit which caused this regression? I'm
> guessing
>
> commit 9ca7d8e6834c40a99622bbe4a88aaf64313ae43c
> Author: Carsten Emde <C.Emde@xxxxxxxxx>
> AuthorDate: Fri Apr 2 22:40:20 2010 +0200
> Commit: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> CommitDate: Tue Apr 6 21:50:03 2010 +0200
>
> mqueue: Convert message queue timeout to use hrtimers

Right, because nobody imagined that the specification would be as
asinine.

I'll pick it up and add a stable tag.

Sigh,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/