diff options
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r-- | fs/ceph/snap.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index b26e12cd8ec3..72c6c022f02b 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c | |||
@@ -648,13 +648,15 @@ static void queue_realm_cap_snaps(struct ceph_snap_realm *realm) | |||
648 | if (!inode) | 648 | if (!inode) |
649 | continue; | 649 | continue; |
650 | spin_unlock(&realm->inodes_with_caps_lock); | 650 | spin_unlock(&realm->inodes_with_caps_lock); |
651 | iput(lastinode); | 651 | /* avoid calling iput_final() while holding |
652 | * mdsc->snap_rwsem or in mds dispatch threads */ | ||
653 | ceph_async_iput(lastinode); | ||
652 | lastinode = inode; | 654 | lastinode = inode; |
653 | ceph_queue_cap_snap(ci); | 655 | ceph_queue_cap_snap(ci); |
654 | spin_lock(&realm->inodes_with_caps_lock); | 656 | spin_lock(&realm->inodes_with_caps_lock); |
655 | } | 657 | } |
656 | spin_unlock(&realm->inodes_with_caps_lock); | 658 | spin_unlock(&realm->inodes_with_caps_lock); |
657 | iput(lastinode); | 659 | ceph_async_iput(lastinode); |
658 | 660 | ||
659 | dout("queue_realm_cap_snaps %p %llx done\n", realm, realm->ino); | 661 | dout("queue_realm_cap_snaps %p %llx done\n", realm, realm->ino); |
660 | } | 662 | } |
@@ -806,7 +808,9 @@ static void flush_snaps(struct ceph_mds_client *mdsc) | |||
806 | ihold(inode); | 808 | ihold(inode); |
807 | spin_unlock(&mdsc->snap_flush_lock); | 809 | spin_unlock(&mdsc->snap_flush_lock); |
808 | ceph_flush_snaps(ci, &session); | 810 | ceph_flush_snaps(ci, &session); |
809 | iput(inode); | 811 | /* avoid calling iput_final() while holding |
812 | * session->s_mutex or in mds dispatch threads */ | ||
813 | ceph_async_iput(inode); | ||
810 | spin_lock(&mdsc->snap_flush_lock); | 814 | spin_lock(&mdsc->snap_flush_lock); |
811 | } | 815 | } |
812 | spin_unlock(&mdsc->snap_flush_lock); | 816 | spin_unlock(&mdsc->snap_flush_lock); |
@@ -950,12 +954,14 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc, | |||
950 | ceph_get_snap_realm(mdsc, realm); | 954 | ceph_get_snap_realm(mdsc, realm); |
951 | ceph_put_snap_realm(mdsc, oldrealm); | 955 | ceph_put_snap_realm(mdsc, oldrealm); |
952 | 956 | ||
953 | iput(inode); | 957 | /* avoid calling iput_final() while holding |
958 | * mdsc->snap_rwsem or mds in dispatch threads */ | ||
959 | ceph_async_iput(inode); | ||
954 | continue; | 960 | continue; |
955 | 961 | ||
956 | skip_inode: | 962 | skip_inode: |
957 | spin_unlock(&ci->i_ceph_lock); | 963 | spin_unlock(&ci->i_ceph_lock); |
958 | iput(inode); | 964 | ceph_async_iput(inode); |
959 | } | 965 | } |
960 | 966 | ||
961 | /* we may have taken some of the old realm's children. */ | 967 | /* we may have taken some of the old realm's children. */ |