alistair23-linux/fs/gfs2
Andreas Gruenbacher 3ce37b2cb4 gfs2: Fix gfs2_lookup_by_inum lock inversion
The current gfs2_lookup_by_inum takes the glock of a presumed inode
identified by block number, verifies that the block is indeed an inode,
and then instantiates and reads the new inode via gfs2_inode_lookup.

However, instantiating a new inode may block on freeing a previous
instance of that inode (__wait_on_freeing_inode), and freeing an inode
requires to take the glock already held, leading to lock inversion and
deadlock.

Fix this by first instantiating the new inode, then verifying that the
block is an inode (if required), and then reading in the new inode, all
in gfs2_inode_lookup.

If the block we are looking for is not an inode, we discard the new
inode via iget_failed, which marks inodes as bad and unhashes them.
Other tasks waiting on that inode will get back a bad inode back from
ilookup or iget_locked; in that case, retry the lookup.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
2016-06-27 09:47:07 -05:00
..
acl.c gfs2: Switch to generic xattr handlers 2016-05-12 22:28:05 -04:00
acl.h gfs2: Switch to generic xattr handlers 2016-05-12 22:28:05 -04:00
aops.c We've got nine patches this time: 2016-05-20 15:11:26 -07:00
bmap.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
bmap.h
dentry.c
dir.c gfs2: Fix gfs2_lookup_by_inum lock inversion 2016-06-27 09:47:07 -05:00
dir.h
export.c GFS2: Don't filter out I_FREEING inodes anymore 2016-03-15 10:46:45 -04:00
file.c We've got nine patches this time: 2016-05-20 15:11:26 -07:00
gfs2.h
glock.c gfs2: Fix gfs2_lookup_by_inum lock inversion 2016-06-27 09:47:07 -05:00
glock.h GFS2: Reduce size of incore inode 2015-12-14 12:19:24 -06:00
glops.c GFS2: Get rid of dead code in inode_go_demote_ok 2016-04-05 11:59:18 -04:00
glops.h
incore.h GFS2: Prevent delete work from occurring on glocks used for create 2016-03-15 10:46:37 -04:00
inode.c gfs2: Fix gfs2_lookup_by_inum lock inversion 2016-06-27 09:47:07 -05:00
inode.h gfs2: Fix gfs2_lookup_by_inum lock inversion 2016-06-27 09:47:07 -05:00
Kconfig
lock_dlm.c
log.c gfs2: clear journal live bit in gfs2_log_flush 2015-12-14 12:19:41 -06:00
log.h
lops.c
lops.h
main.c gfs2: Initialize iopen glock holder for new inodes 2016-06-17 08:35:03 -05:00
Makefile
meta_io.c We've got nine patches this time: 2016-05-20 15:11:26 -07:00
meta_io.h GFS2: Refactor gfs2_remove_from_journal 2016-05-06 11:27:27 -05:00
ops_fstype.c gfs2: Fix gfs2_lookup_by_inum lock inversion 2016-06-27 09:47:07 -05:00
quota.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
quota.h GFS2: Make rgrp reservations part of the gfs2_inode structure 2015-12-14 12:16:38 -06:00
recovery.c
recovery.h
rgrp.c GFS2: don't set rgrp gl_object until it's inserted into rgrp tree 2016-06-10 07:01:58 -05:00
rgrp.h GFS2: Make rgrp reservations part of the gfs2_inode structure 2015-12-14 12:16:38 -06:00
super.c don't bother with ->d_inode->i_sb - it's always equal to ->d_sb 2016-04-10 17:11:51 -04:00
super.h
sys.c
sys.h
trace_gfs2.h
trans.c
trans.h
util.c GFS2: ignore unlock failures after withdraw 2016-03-24 08:28:48 -04:00
util.h GFS2: Make rgrp reservations part of the gfs2_inode structure 2015-12-14 12:16:38 -06:00
xattr.c gfs2: Switch to generic xattr handlers 2016-05-12 22:28:05 -04:00
xattr.h gfs2: Remove gfs2_xattr_acl_chmod 2015-12-06 21:25:17 -05:00