linux-stable/fs/orangefs
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
..
acl.c get rid of pointless includes of fs_struct.h 2018-02-22 14:28:50 -05:00
dcache.c orangefs: reverse sense of is-inode-stale test in d_revalidate 2018-02-06 16:38:13 -05:00
devorangefs-req.c orangefs: make several *_operations structs static 2018-04-03 21:55:27 -04:00
dir.c orangefs: stop setting atime on inode dirty 2017-11-13 15:10:11 -05:00
downcall.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
file.c orangefs: implement vm_ops->fault 2018-04-03 21:55:27 -04:00
inode.c orangefs: make several *_operations structs static 2018-04-03 21:55:27 -04:00
Kconfig Orangefs: kernel client part 7 2015-10-03 11:40:00 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-11 15:36:37 -04:00
orangefs-bufmap.c orangefs: bug fix for a race condition when getting a slot 2018-04-02 08:10:17 -04:00
orangefs-bufmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-cache.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-debug.h orangefs: remove unused code 2018-04-03 21:55:28 -04:00
orangefs-debugfs.c orangefs: remove gossip_ldebug and gossip_lerr 2018-02-06 16:38:12 -05:00
orangefs-debugfs.h orangefs: make orangefs_client_debug_init static 2018-02-06 16:38:12 -05:00
orangefs-dev-proto.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-kernel.h orangefs: remove unused code 2018-04-03 21:55:28 -04:00
orangefs-mod.c orangefs: Delete error messages for a failed memory allocation in five functions 2017-09-14 14:58:29 -04:00
orangefs-sysfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
orangefs-sysfs.h Orangefs: change pvfs2 filenames to orangefs 2015-12-04 12:56:14 -05:00
orangefs-utils.c treewide: Fix typos in printk 2018-03-27 09:51:22 +02:00
protocol.h orangefs: remove unused code 2018-04-03 21:55:28 -04:00
super.c orangefs_kill_sb(): deal with allocation failures 2018-04-15 23:49:12 -04:00
symlink.c orangefs: stop setting atime on inode dirty 2017-11-13 15:10:11 -05:00
upcall.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
waitqueue.c orangefs: use list_for_each_entry_safe in purge_waiting_ops 2018-01-22 13:51:14 -08:00
xattr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00