linux/fs/ocfs2
Junxiao Bi b1432a2a35 ocfs2: dlm: fix race between purge and get lock resource
There is a race window in dlm_get_lock_resource(), which may return a
lock resource which has been purged.  This will cause the process to
hang forever in dlmlock() as the ast msg can't be handled due to its
lock resource not existing.

    dlm_get_lock_resource {
        ...
        spin_lock(&dlm->spinlock);
        tmpres = __dlm_lookup_lockres_full(dlm, lockid, namelen, hash);
        if (tmpres) {
             spin_unlock(&dlm->spinlock);
             >>>>>>>> race window, dlm_run_purge_list() may run and purge
                              the lock resource
             spin_lock(&tmpres->spinlock);
             ...
             spin_unlock(&tmpres->spinlock);
        }
    }

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-05-05 17:10:11 -07:00
..
cluster Revert "ocfs2: incorrect check for debugfs returns" 2015-04-21 09:17:28 -07:00
dlm ocfs2: dlm: fix race between purge and get lock resource 2015-05-05 17:10:11 -07:00
dlmfs VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
Kconfig
Makefile
acl.c ocfs2: remove unnecessary else in ocfs2_set_acl() 2015-02-10 14:30:28 -08:00
acl.h
alloc.c ocfs2: one function call less in ocfs2_merge_rec_right() after error detection 2015-04-14 16:48:57 -07:00
alloc.h ocfs2: reflink: fix slow unlink for refcounted file 2014-12-18 19:08:11 -08:00
aops.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-16 23:27:56 -04:00
aops.h fs: move struct kiocb to fs.h 2015-03-25 20:28:11 -04:00
blockcheck.c
blockcheck.h
buffer_head_io.c
buffer_head_io.h
dcache.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
dcache.h
dir.c ocfs2: fix a typo in the copyright statement 2015-04-14 16:48:58 -07:00
dir.h VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
dlmglue.c Revert "ocfs2: incorrect check for debugfs returns" 2015-04-21 09:17:28 -07:00
dlmglue.h
export.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
export.h
extent_map.c
extent_map.h
file.c Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-15 13:22:56 -07:00
file.h ocfs2: prepare some interfaces used in append direct io 2015-02-16 17:56:04 -08:00
heartbeat.c
heartbeat.h
inode.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
inode.h ocfs2: wait for orphan recovery first once append O_DIRECT write crash 2015-02-16 17:56:05 -08:00
ioctl.c
ioctl.h
journal.c ocfs2: wait for orphan recovery first once append O_DIRECT write crash 2015-02-16 17:56:05 -08:00
journal.h ocfs2: add functions to add and remove inode in orphan dir 2015-02-16 17:56:04 -08:00
localalloc.c ocfs2: fix possible uninitialized variable access 2015-04-14 16:48:58 -07:00
localalloc.h
locks.c
locks.h
mmap.c mm: drop vm_ops->remap_pages and generic_file_remap_pages() stub 2015-02-10 14:30:30 -08:00
mmap.h
move_extents.c ocfs2: remove bogus NULL check in ocfs2_move_extents() 2014-12-10 17:41:04 -08:00
move_extents.h
namei.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
namei.h ocfs2: add functions to add and remove inode in orphan dir 2015-02-16 17:56:04 -08:00
ocfs1_fs_compat.h
ocfs2.h ocfs2: make append_dio an incompat feature 2015-03-12 18:46:07 -07:00
ocfs2_fs.h ocfs2: make append_dio an incompat feature 2015-03-12 18:46:07 -07:00
ocfs2_ioctl.h
ocfs2_lockid.h
ocfs2_lockingver.h
ocfs2_trace.h
quota.h ocfs2: Move OLQF_CLEAN flag out of generic quota flags 2015-01-21 19:21:30 +01:00
quota_global.c
quota_local.c Merge branch 'akpm' (patches from Andrew) 2015-02-10 16:45:56 -08:00
refcounttree.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
refcounttree.h
reservations.c ocfs2: make resv_lock spinlock static 2015-02-10 14:30:29 -08:00
reservations.h
resize.c
resize.h
slot_map.c ocfs2: one function call less in ocfs2_init_slot_info() after error detection 2015-04-14 16:48:57 -07:00
slot_map.h
stack_o2cb.c ocfs2: avoid a pointless delay in o2cb_cluster_check() 2015-04-14 16:48:57 -07:00
stack_user.c ocfs2: one function call less in user_cluster_connect() after error detection 2015-04-14 16:48:57 -07:00
stackglue.c
stackglue.h
suballoc.c ocfs2: rollback the cleared bits if error occurs after ocfs2_block_group_clear_bits 2015-04-14 16:48:58 -07:00
suballoc.h
super.c Revert "ocfs2: incorrect check for debugfs returns" 2015-04-21 09:17:28 -07:00
super.h
symlink.c
symlink.h
sysfile.c
sysfile.h
uptodate.c
uptodate.h
xattr.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
xattr.h