lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 26 Feb 2021 10:48:40 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     John Ogness <john.ogness@...utronix.de>
Cc:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org
Subject: Re: synchronization model: was: Re: [PATCH printk-rework 09/14]
 printk: introduce a kmsg_dump iterator

On Fri 2021-02-26 09:36:21, John Ogness wrote:
> On 2021-02-25, Petr Mladek <pmladek@...e.com> wrote:
> > IMHO, a better design would be:
> >
> > 1. dumper->dump() callback should have only one parameter @reason.
> >    The callback should define its own iterator, buffer, and
> >    do the dump.
> 
> Unfortunately this won't work because drivers/mtd/mtdoops.c is using the
> dumper parameter for container_of().

Ah, I have missed this.

mtdoops code is generic even though everything is static so that there
is always only one instance. But this use case makes sense in general.

> So we will need 2 parameters: dumper and reason.
> 
> Can we agree to proceed with 2 parameters in the callback?

Yup, go for it.

> > 2. dumpe->dump() callback should synchronize the entire operation
> >    using its own locks. Only the callback knows whether it is
> >    safe to do more dumps in parallel. Only the callback knows
> >    whether it is called only during panic() when no locks
> >    are needed.
> 
> Agreed. I implemented this part for the v3 series.

Great!

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ