Al Viro 1e2e547a93 do d_instantiate/unlock_new_inode combinations safely
For anything NFS-exported we do _not_ want to unlock new inode
before it has grown an alias; original set of fixes got the
ordering right, but missed the nasty complication in case of
lockdep being enabled - unlock_new_inode() does
	lockdep_annotate_inode_mutex_key(inode)
which can only be done before anyone gets a chance to touch
->i_mutex.  Unfortunately, flipping the order and doing
unlock_new_inode() before d_instantiate() opens a window when
mkdir can race with open-by-fhandle on a guessed fhandle, leading
to multiple aliases for a directory inode and all the breakage
that follows from that.

	Correct solution: a new primitive (d_instantiate_new())
combining these two in the right order - lockdep annotate, then
d_instantiate(), then the rest of unlock_new_inode().  All
combinations of d_instantiate() with unlock_new_inode() should
be converted to that.

Cc: stable@kernel.org	# 2.6.29 and later
Tested-by: Mike Marshall <hubcap@omnibond.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2018-05-11 15:36:37 -04:00
..
2018-04-07 09:08:24 -07:00
2018-04-11 10:28:36 -07:00
2018-04-10 12:25:30 -07:00
2018-03-14 13:31:23 +01:00
2018-03-27 13:18:09 -04:00
2018-04-12 12:55:50 -07:00
2018-04-03 16:27:08 -04:00
2018-04-13 17:10:27 -07:00
2018-04-12 13:28:22 -07:00
2018-04-10 10:25:57 -07:00
2018-04-11 10:28:39 -07:00
2018-04-11 10:28:37 -07:00
2017-12-07 14:23:30 -05:00
2018-04-11 10:28:39 -07:00
2018-04-11 10:28:39 -07:00
2018-01-29 07:27:24 -08:00
2018-02-06 10:41:33 -08:00
2018-02-15 15:34:42 -05:00
2018-04-04 12:44:02 -07:00