• Davidlohr Bueso's avatar
    ipc/sem: make semctl setting sempid consistent · a5f4db87
    Davidlohr Bueso authored
    As indicated by bug#112271, Linux sets the sempid value upon semctl, and
    not only for semop calls.  However, within semctl we only do this for
    SETVAL, leaving SETALL without updating the field, and therefore rather
    inconsistent behavior when compared to other Unices.
    There is really no documentation regarding this and therefore users
    should not make assumptions.  With this patch, along with updating
    semctl.2 manpages, this scenario should become less ambiguous As such,
    set sempid on SETALL cmd.
    Also update some in-code documentation, specifying where the sempid is
    Passes ltp and custom testcase where a child (fork) does SETALL to the
    Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
    Reported-by: default avatarPhilip Semanchuk <linux_kernel.20.ick@spamgourmet.com>
    Cc: Michael Kerrisk <mtk.manpages@gmail.com>
    Cc: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
    Cc: Manfred Spraul <manfred@colorfullife.com>
    Cc: Herton R. Krzesinski <herton@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
sem.c 56.3 KB