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:   Mon, 29 Aug 2022 13:08:58 +1000
From:   "NeilBrown" <neilb@...e.de>
To:     "Al Viro" <viro@...iv.linux.org.uk>
Cc:     "Linus Torvalds" <torvalds@...ux-foundation.org>,
        "Daire Byrne" <daire@...g.com>,
        "Trond Myklebust" <trond.myklebust@...merspace.com>,
        "Chuck Lever" <chuck.lever@...cle.com>,
        "Linux NFS Mailing List" <linux-nfs@...r.kernel.org>,
        linux-fsdevel@...r.kernel.org,
        "LKML" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/10] VFS: support concurrent renames.

On Sat, 27 Aug 2022, Al Viro wrote:
> On Fri, Aug 26, 2022 at 12:10:43PM +1000, NeilBrown wrote:
> > Allow object can now be renamed from or to a directory in which a create
> > or unlink is concurrently happening.
> > 
> > Two or more renames with the one directory can also be concurrent.
> > s_vfs_rename_mutex still serialises lookups for cross-directory renames,
> > but the renames themselves can proceed concurrently.
> 
> Wha...?  <checks>
> Not true, fortunately - you *do* hold ->s_vfs_rename_mutex over the
> rename itself.  If not for that, it would be utterly broken.
> And I don't care for NFS server rejecting that - we are *NOT* taking
> loop prevention logics into every filesystem.  It's highly non-local
> and trying to handle it with your per-dentry flags is going to be
> painful as hell, if at all possible.
> 

I don't know what happened there - I let myself get confused somewhere
in the process.  You are of course right that s_vfs_rename_mutex is held
the whole time.  I wasn't intending to try to change that.

> > +	if (d1 < d2) {
> > +		ok1 = d_lock_update_nested(d1, p1, last1, I_MUTEX_PARENT);
> > +		ok2 = d_lock_update_nested(d2, p2, last2, I_MUTEX_PARENT2);
> > +	} else {
> > +		ok2 = d_lock_update_nested(d2, p2, last2, I_MUTEX_PARENT);
> > +		ok1 = d_lock_update_nested(d1, p1, last1, I_MUTEX_PARENT2);
> > +	}
> 
> Explain, please.  What's that ordering about?
> 
Deadlock avoidance, just like in the same-directory case.

But I guess as s_vfs_rename_mutex is held, ordering cannot matter.
I'll remove the ordering.

Thanks,
NeilBrown

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ