• Junxiao Bi's avatar
    ocfs2: dlm: fix race between purge and get lock resource · b1432a2a
    Junxiao Bi authored
    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: default avatarJunxiao 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: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    b1432a2a
Name
Last commit
Last update
..
cluster Loading commit data...
dlm Loading commit data...
dlmfs Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
acl.c Loading commit data...
acl.h Loading commit data...
alloc.c Loading commit data...
alloc.h Loading commit data...
aops.c Loading commit data...
aops.h Loading commit data...
blockcheck.c Loading commit data...
blockcheck.h Loading commit data...
buffer_head_io.c Loading commit data...
buffer_head_io.h Loading commit data...
dcache.c Loading commit data...
dcache.h Loading commit data...
dir.c Loading commit data...
dir.h Loading commit data...
dlmglue.c Loading commit data...
dlmglue.h Loading commit data...
export.c Loading commit data...
export.h Loading commit data...
extent_map.c Loading commit data...
extent_map.h Loading commit data...
file.c Loading commit data...
file.h Loading commit data...
heartbeat.c Loading commit data...
heartbeat.h Loading commit data...
inode.c Loading commit data...
inode.h Loading commit data...
ioctl.c Loading commit data...
ioctl.h Loading commit data...
journal.c Loading commit data...
journal.h Loading commit data...
localalloc.c Loading commit data...
localalloc.h Loading commit data...
locks.c Loading commit data...
locks.h Loading commit data...
mmap.c Loading commit data...
mmap.h Loading commit data...
move_extents.c Loading commit data...
move_extents.h Loading commit data...
namei.c Loading commit data...
namei.h Loading commit data...
ocfs1_fs_compat.h Loading commit data...
ocfs2.h Loading commit data...
ocfs2_fs.h Loading commit data...
ocfs2_ioctl.h Loading commit data...
ocfs2_lockid.h Loading commit data...
ocfs2_lockingver.h Loading commit data...
ocfs2_trace.h Loading commit data...
quota.h Loading commit data...
quota_global.c Loading commit data...
quota_local.c Loading commit data...
refcounttree.c Loading commit data...
refcounttree.h Loading commit data...
reservations.c Loading commit data...
reservations.h Loading commit data...
resize.c Loading commit data...
resize.h Loading commit data...
slot_map.c Loading commit data...
slot_map.h Loading commit data...
stack_o2cb.c Loading commit data...
stack_user.c Loading commit data...
stackglue.c Loading commit data...
stackglue.h Loading commit data...
suballoc.c Loading commit data...
suballoc.h Loading commit data...
super.c Loading commit data...
super.h Loading commit data...
symlink.c Loading commit data...
symlink.h Loading commit data...
sysfile.c Loading commit data...
sysfile.h Loading commit data...
uptodate.c Loading commit data...
uptodate.h Loading commit data...
xattr.c Loading commit data...
xattr.h Loading commit data...