[Devel] [PATCH 0/2] fuse: fix signals handling while processing request
Stanislav Kinsburskiy
skinsbursky at virtuozzo.com
Fri Oct 14 03:30:15 PDT 2016
14.10.2016 02:23, Maxim Patlasov пишет:
> Stas,
>
>
> The series look fine, so:
>
> Acked-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
>
>
> But, please, refine the description of the second patch. It must
> explain clearly why the patch fixes the problem:
>
> block_sigs() blocks ordinary non-fatal signals as expected, but
> surprisingly SIGTRAP is special: it does not matter whether it comes
> before or after block_sigs(), the latter does not affect SIGTRAP at
> all! And in contrast, wait_event_killable() is immune to it -- only
> fatal sig can wake it up.
>
No, Maxim. You make a mistake here.
There is nothing special with SIGTRAP (although it's being sometimes
sent via force_sig_info()).
The problem is described as it is: block_sigs() doesn't (!) clear
TIG_SIGPENDING flag. All it does is blocking future signals to arrive.
Moreover, __set_task_blocked() call recalc_sigpending(), which check
whether any of the signals to block is present in process pending mask,
and if so - set (!) TIF_SIGPENDING on the task.
IOW, any pending signal remains pending after call to blocks_sigs().
And that's is the root of the issue (as it described in the patch comment).
> Thanks,
> Maxim
>
> On 10/13/2016 03:03 AM, Stanislav Kinsburskiy wrote:
>> This patch fixes wrong SIGBUS result in page fault handler for fuse
>> file, when
>> process received a signal.
>>
>> https://jira.sw.ru/browse/PSBM-53581
>>
>> ---
>>
>> Stanislav Kinsburskiy (2):
>> new helper: wait_event_killable_exclusive()
>> fuse: handle only fatal signals while waiting request answer
>>
>>
>> fs/fuse/dev.c | 42 ++++++++++++++++--------------------------
>> include/linux/wait.h | 26 ++++++++++++++++++++++++++
>> 2 files changed, 42 insertions(+), 26 deletions(-)
>>
>> --
>
More information about the Devel
mailing list