[Devel] [PATCH vz7] VE/sysrq-trigger: fix log limiting

Konstantin Khorenko khorenko at virtuozzo.com
Thu Sep 30 14:12:25 MSK 2021


On 30.09.2021 14:03, Nikita Yushchenko wrote:
> Log first 10 events, not all events but 11-th.
> 
> Fixes: 9d3568f8a9bb ("VE/sysrq-trigger: make it VE-namespace aware")
> Signed-off-by: Nikita Yushchenko <nikita.yushchenko at virtuozzo.com>

ack

> ---
>   drivers/tty/sysrq.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
> index 4228469e1632..6db02079b79f 100644
> --- a/drivers/tty/sysrq.c
> +++ b/drivers/tty/sysrq.c
> @@ -1049,9 +1049,11 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
>   			return -EFAULT;
>   		if (ve_is_super(cur))
>   			__handle_sysrq(c, false);
> -		else if (pnum--)
> +		else if (pnum > 0) {
>   			printk("SysRq: CT#%s sent '%c' magic key.\n",
>   				cur->ve_name, c);
> +			pnum--;
> +		}
>   	}
>   
>   	return count;
> 


More information about the Devel mailing list