• Roland McGrath's avatar
    [PATCH] clear false pending signal indication in core dump · 10059cbc
    Roland McGrath authored
    When kill is used to force a core dump, __group_complete_signal uses the
    group_stop_count machinery to stop other threads from doing anything more
    before the signal-taking thread starts the coredump synchronization.  This
    intentionally results in group_stop_count always still being > 0 when the
    signal-taking thread gets into do_coredump.  However, that has the
    unintended effect that signal_pending can return true when called from the
    filesystem code while writing the core dump file.  For NFS mounts using the
    "intr" option, this results in NFS operations bailing out before they even
    try, so core files never get successfully dumped on such a filesystem when
    the crash was induced by an asynchronous process-wide signal.
    
    This patch fixes the problem by clearing group_stop_count after the
    coredump synchronization is complete.
    
    The locking I threw in is not directly related, but always should have been
    there and may avoid some potential races with kill.
    Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    10059cbc
exec.c 33.5 KB