aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/snap.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-03-09 15:52:26 -0500
committerSage Weil <sage@newdream.net>2010-03-21 00:33:07 -0400
commit052bb34af3bf8ae2001b9f03d884ba0def3e427c (patch)
treedb8aecde5b43263d9f3a2947663cb55de4414545 /fs/ceph/snap.c
parent978097c907b58a2d085bbf7632bee1a5a7e6f6ba (diff)
ceph: add missing locking to protect i_snap_realm_item during split
All ci->i_snap_realm_item/realm->inodes_with_caps manipulation should be protected by realm->inodes_with_caps_lock. This bug would have only bit us in a rare race with a realm split (during some snap creations). Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r--fs/ceph/snap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c
index bf2a5f3846a4..8a43bc8675eb 100644
--- a/fs/ceph/snap.c
+++ b/fs/ceph/snap.c
@@ -818,7 +818,9 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,
818 * queued (again) by ceph_update_snap_trace() 818 * queued (again) by ceph_update_snap_trace()
819 * below. Queue it _now_, under the old context. 819 * below. Queue it _now_, under the old context.
820 */ 820 */
821 spin_lock(&realm->inodes_with_caps_lock);
821 list_del_init(&ci->i_snap_realm_item); 822 list_del_init(&ci->i_snap_realm_item);
823 spin_unlock(&realm->inodes_with_caps_lock);
822 spin_unlock(&inode->i_lock); 824 spin_unlock(&inode->i_lock);
823 825
824 ceph_queue_cap_snap(ci, 826 ceph_queue_cap_snap(ci,