aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorGreg Farnum <gregf@hq.newdream.net>2010-10-06 18:46:30 -0400
committerSage Weil <sage@newdream.net>2010-10-07 11:00:24 -0400
commit21b559de56695d36b3f0819b7e2454737db254f8 (patch)
tree41559b37754818d637d11aec1b61a138d7a8efb5 /fs/ceph/caps.c
parentbba0cd0e3d97472855840af817b766e3f632a501 (diff)
ceph: send cap release message early on failed revoke.
If an MDS tries to revoke caps that we don't have, we want to send releases early since they probably contain the caps message the MDS is looking for. Previously, we only sent the messages if we didn't have the inode either. But in a multi-mds system we can retain the inode after dropping all caps for a single MDS. Signed-off-by: Greg Farnum <gregf@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 73c153092f72..97de325a49f8 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2774,15 +2774,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
2774 if (op == CEPH_CAP_OP_IMPORT) 2774 if (op == CEPH_CAP_OP_IMPORT)
2775 __queue_cap_release(session, vino.ino, cap_id, 2775 __queue_cap_release(session, vino.ino, cap_id,
2776 mseq, seq); 2776 mseq, seq);
2777 2777 goto flush_cap_releases;
2778 /*
2779 * send any full release message to try to move things
2780 * along for the mds (who clearly thinks we still have this
2781 * cap).
2782 */
2783 ceph_add_cap_releases(mdsc, session);
2784 ceph_send_cap_releases(mdsc, session);
2785 goto done;
2786 } 2778 }
2787 2779
2788 /* these will work even if we don't have a cap yet */ 2780 /* these will work even if we don't have a cap yet */
@@ -2810,7 +2802,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
2810 dout(" no cap on %p ino %llx.%llx from mds%d\n", 2802 dout(" no cap on %p ino %llx.%llx from mds%d\n",
2811 inode, ceph_ino(inode), ceph_snap(inode), mds); 2803 inode, ceph_ino(inode), ceph_snap(inode), mds);
2812 spin_unlock(&inode->i_lock); 2804 spin_unlock(&inode->i_lock);
2813 goto done; 2805 goto flush_cap_releases;
2814 } 2806 }
2815 2807
2816 /* note that each of these drops i_lock for us */ 2808 /* note that each of these drops i_lock for us */
@@ -2834,6 +2826,17 @@ void ceph_handle_caps(struct ceph_mds_session *session,
2834 ceph_cap_op_name(op)); 2826 ceph_cap_op_name(op));
2835 } 2827 }
2836 2828
2829 goto done;
2830
2831flush_cap_releases:
2832 /*
2833 * send any full release message to try to move things
2834 * along for the mds (who clearly thinks we still have this
2835 * cap).
2836 */
2837 ceph_add_cap_releases(mdsc, session);
2838 ceph_send_cap_releases(mdsc, session);
2839
2837done: 2840done:
2838 mutex_unlock(&session->s_mutex); 2841 mutex_unlock(&session->s_mutex);
2839done_unlocked: 2842done_unlocked: