Log first 10 events, not all events but 11-th.

Fixes: df5ab55fa5ee ("VE/sysrq-trigger: make it VE-namespace aware")
Signed-off-by: Nikita Yushchenko <[email protected]>
---
 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 243c28e5158b..5880da6db564 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -1113,9 +1113,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;
-- 
2.30.2

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to