android_kernel_oneplus_msm8998/fs/f2fs
Al Viro 03bb758894 do d_instantiate/unlock_new_inode combinations safely
commit 1e2e547a93a00ebc21582c06ca3c6cfea2a309ee upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:48:52 +02:00
..
acl.c f2fs: Don't clear SGID when inheriting ACLs 2017-07-27 15:06:07 -07:00
acl.h f2fs: avoid deadlock on init_inode_metadata 2014-11-03 16:07:33 -08:00
checkpoint.c f2fs: support lower priority asynchronous readahead in ra_meta_pages 2015-10-12 14:03:15 -07:00
crypto.c f2fs crypto: replace some BUG_ON()'s with error checks 2017-10-27 10:23:18 +02:00
crypto_fname.c f2fs crypto: replace some BUG_ON()'s with error checks 2017-10-27 10:23:18 +02:00
crypto_key.c fscrypt: fix dereference of NULL user_key_payload 2017-10-27 10:23:18 +02:00
crypto_policy.c fscrypt: fix context consistency check when key(s) unavailable 2017-05-25 14:30:11 +02:00
data.c f2fs: fix a dead loop in f2fs_fiemap() 2018-05-16 10:06:51 +02:00
debug.c f2fs: set ->owner for debugfs status file's file_operations 2017-01-06 11:16:13 +01:00
dir.c fscrypt: avoid collisions when presenting long encrypted filenames 2017-05-25 14:30:11 +02:00
extent_cache.c f2fs: fix a bug caused by NULL extent tree 2018-03-03 10:19:41 +01:00
f2fs.h f2fs: check entire encrypted bigname when finding a dentry 2017-05-25 14:30:11 +02:00
f2fs_crypto.h fscrypt: remove broken support for detecting keyring key revocation 2017-03-31 09:49:54 +02:00
file.c fscrypto: require write access to mount to set encryption policy 2017-10-27 10:23:18 +02:00
gc.c f2fs: relax node version check for victim data in gc 2018-03-22 09:23:22 +01:00
gc.h f2fs: support synchronous gc in ioctl 2015-10-09 16:20:56 -07:00
hash.c f2fs: check entire encrypted bigname when finding a dentry 2017-05-25 14:30:11 +02:00
inline.c f2fs: check entire encrypted bigname when finding a dentry 2017-05-25 14:30:11 +02:00
inode.c don't put symlink bodies in pagecache into highmem 2018-02-16 20:09:38 +01:00
Kconfig f2fs: fix typo 2015-08-21 22:43:32 -07:00
Makefile f2fs: maintain extent cache in separated file 2015-08-04 14:09:58 -07:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-30 07:48:52 +02:00
node.c f2fs: export ra_nid_pages to sysfs 2015-10-12 14:03:43 -07:00
node.h f2fs: export ra_nid_pages to sysfs 2015-10-12 14:03:43 -07:00
recovery.c f2fs: check hot_data for roll-forward recovery 2017-09-27 11:00:12 +02:00
segment.c f2fs: fix to clear GCed flag for atomic written page 2015-10-22 09:37:13 -07:00
segment.h Revert "f2fs: do not skip dentry block writes" 2015-10-12 13:38:02 -07:00
shrinker.c f2fs: shrink free_nids entries 2015-08-20 09:00:06 -07:00
super.c f2fs: sanity check checkpoint segno and blkoff 2017-08-11 09:08:51 -07:00
trace.c f2fs: add sbi and page pointer in f2fs_io_info 2015-05-28 15:41:32 -07:00
trace.h f2fs: add sbi and page pointer in f2fs_io_info 2015-05-28 15:41:32 -07:00
xattr.c f2fs: xattr simplifications 2015-11-13 20:34:34 -05:00
xattr.h f2fs crypto: add encryption xattr support 2015-05-28 15:41:47 -07:00