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, 7 Dec 2021 13:17:41 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     cgel.zte@...il.com
Cc:     viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, Lv Ruyi <lv.ruyi@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] fs/dcache: prevent repeated locking

On Tue, Dec 07, 2021 at 10:16:46AM +0000, cgel.zte@...il.com wrote:
> From: Lv Ruyi <lv.ruyi@....com.cn>
> 
> Move the spin_lock above the restart to prevent to lock twice 
> when the code goto restart.

This is madness.

void d_prune_aliases(struct inode *inode)
        spin_lock(&inode->i_lock);
                        if (likely(!dentry->d_lockref.count)) {
                                __dentry_kill(dentry);
                                goto restart;
...
static void __dentry_kill(struct dentry *dentry)
        if (dentry->d_inode)
                dentry_unlink_inode(dentry);
...
static void dentry_unlink_inode(struct dentry * dentry)
        spin_unlock(&inode->i_lock);

Did you even test this patch?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ