ceph: use i_ceph_lock instead of i_lock
authorSage Weil <sage@newdream.net>
Wed, 30 Nov 2011 17:47:09 +0000 (09:47 -0800)
committerSage Weil <sage@newdream.net>
Wed, 7 Dec 2011 18:46:44 +0000 (10:46 -0800)
commitbe655596b3de5873f994ddbe205751a5ffb4de39
treecf6e53c6344f87a47ac68d6a6ff4d7dac6e5c25e
parent51703306b3b9ea7c05728040998521e47358147b
ceph: use i_ceph_lock instead of i_lock

We have been using i_lock to protect all kinds of data structures in the
ceph_inode_info struct, including lists of inodes that we need to iterate
over while avoiding races with inode destruction.  That requires grabbing
a reference to the inode with the list lock protected, but igrab() now
takes i_lock to check the inode flags.

Changing the list lock ordering would be a painful process.

However, using a ceph-specific i_ceph_lock in the ceph inode instead of
i_lock is a simple mechanical change and avoids the ordering constraints
imposed by igrab().

Reported-by: Amon Ott <a.ott@m-privacy.de>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/addr.c
fs/ceph/caps.c
fs/ceph/dir.c
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/ioctl.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h
fs/ceph/snap.c
fs/ceph/super.h
fs/ceph/xattr.c