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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Oct 2017 22:23:35 +0200
From:   "Luis R. Rodriguez" <mcgrof@...nel.org>
To:     Bart Van Assche <Bart.VanAssche@....com>
Cc:     "pavel@....cz" <pavel@....cz>,
        "darrick.wong@...cle.com" <darrick.wong@...cle.com>,
        "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
        "ming.lei@...hat.com" <ming.lei@...hat.com>,
        "rjw@...ysocki.net" <rjw@...ysocki.net>,
        "mcgrof@...nel.org" <mcgrof@...nel.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "jikos@...nel.org" <jikos@...nel.org>,
        "len.brown@...el.com" <len.brown@...el.com>,
        "tytso@....edu" <tytso@....edu>,
        "boris.ostrovsky@...cle.com" <boris.ostrovsky@...cle.com>,
        "ONeukum@...e.com" <ONeukum@...e.com>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "nborisov@...e.com" <nborisov@...e.com>,
        "oleg.b.antonyan@...il.com" <oleg.b.antonyan@...il.com>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
        "linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
        "jgross@...e.com" <jgross@...e.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "oleksandr@...alenko.name" <oleksandr@...alenko.name>,
        "todd.e.brandt@...ux.intel.com" <todd.e.brandt@...ux.intel.com>,
        "jack@...e.cz" <jack@...e.cz>
Subject: Re: [RFC 2/5] fs: freeze on suspend and thaw on resume

On Tue, Oct 03, 2017 at 08:02:22PM +0000, Bart Van Assche wrote:
> On Tue, 2017-10-03 at 11:53 -0700, Luis R. Rodriguez wrote:
> > +static bool super_allows_freeze(struct super_block *sb)
> > +{
> > +	return !!(sb->s_type->fs_flags & FS_FREEZE_ON_SUSPEND);
> > +}
> 
> A minor comment: if "!!" would be left out the compiler will perform the
> conversion from int to bool implicitly

For all compilers?

> so I propose to leave out the "!!" and parentheses.

OK!

> Anyway, I agree with the approach of this patch and I think
> that freezing filesystems before processes are frozen would be a big step
> forward.

Great! But please note, the current implementation calls fs_suspend_freeze()
*after* try_to_freeze_tasks(), ie: this implementation freezes userspace and
only after then filesystems.

Order will be *critical* here to get right, so we should definitely figure
out if this is definitely the right place (TM) to call fs_suspend_freeze().

Lastly, a final minor implementation note:

I think using a PM notifier would have been much cleaner, in fact it was my the
way I originally implemented this orthogonally to Jiri's work, however to get
this right the semantics of __pm_notifier_call_chain() would need to be
expanded with another state, perhaps PM_USERSPACE_FROZEN, for example. I
decided in the end a new state was not worth it give we would just have one
user: fs freezing. So to be clear using a notifier to wrap this code into
the fs code and not touching kernel/power/process.c is not possible with
today's semantics nor do I think its worth it to expand on these semantics.

This approach is explicit about order and requirements for those that should
care: those that will maintain kernel/power/process.c and friends. Having
this in a notifier would shift this implicitly.

  Luis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ