android_kernel_samsung_univ.../fs/ufs
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
..
balloc.c ufs: restore maintaining ->i_blocks 2017-06-14 13:16:24 +02:00
cylinder.c
dir.c ufs: use dir_pages instead of ufs_dir_pages() 2015-06-23 18:02:01 -04:00
file.c make new_sync_{read,write}() static 2015-04-11 22:29:40 -04:00
ialloc.c fs/ufs: restore s_lock mutex 2015-06-16 02:07:38 -04:00
inode.c ufs_getfrag_block(): we only grab ->truncate_mutex on block creation path 2017-06-14 13:16:24 +02:00
Kconfig fs/ufs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:06 -08:00
Makefile ufs: move truncate code into inode.c 2015-07-06 17:39:30 -04:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-30 07:48:52 +02:00
super.c ufs: set correct ->s_maxsize 2017-06-14 13:16:24 +02:00
swab.h ufs: replace __inline with inline 2008-04-28 08:58:45 -07:00
symlink.c ufs: switch to simple_follow_link() 2015-05-10 22:18:25 -04:00
ufs_fs.h fs/ufs: get rid of write_super 2012-07-22 23:58:16 +04:00
ufs.h ufs: move truncate code into inode.c 2015-07-06 17:39:30 -04:00
util.c fs: ufs: remove cast for kmalloc return value 2013-03-18 14:15:58 +01:00
util.h fix ufs_isblockset() 2017-06-14 13:16:24 +02:00