tmp_suning_uos_patched/fs/kernfs
Tejun Heo f83f3c5156 kernfs: fix locking around kernfs_ops->release() callback
The release callback may be called from two places - file release
operation and kernfs open file draining.  kernfs_open_file->mutex is
used to synchronize the two callsites.  This unfortunately leads to
possible circular locking because of->mutex is used to protect the
usual kernfs operations which may use locking constructs which are
held while removing and thus draining kernfs files.

@of->mutex is for synchronizing concurrent kernfs access operations
and all we need here is synchronization between the releaes and drain
paths.  As the drain path has to grab kernfs_open_file_mutex anyway,
let's use the mutex to synchronize the release operation instead.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Tony Lindgren <tony@atomide.com>
Fixes: 0e67db2f9f ("kernfs: add kernfs_ops->open/release() callbacks")
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-21 15:49:25 -05:00
..
dir.c kernfs: add kernfs_ops->open/release() callbacks 2016-12-27 14:49:03 -05:00
file.c kernfs: fix locking around kernfs_ops->release() callback 2017-02-21 15:49:25 -05:00
inode.c kernfs: Declare two local data structures static 2016-11-29 20:58:31 +01:00
Kconfig kernfs: add CONFIG_KERNFS 2014-02-07 16:08:57 -08:00
kernfs-internal.h kernfs: add kernfs_ops->open/release() callbacks 2016-12-27 14:49:03 -05:00
Makefile
mount.c kernfs: Switch to generic xattr handlers 2016-10-06 22:17:38 -04:00
symlink.c vfs: remove ".readlink = generic_readlink" assignments 2016-12-09 16:45:04 +01:00