Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208839
b: refs/heads/master
c: 154f42c
h: refs/heads/master
i:
  208837: 8bc95ef
  208835: 0e7e1d4
  208831: 44f0b28
v: v3
  • Loading branch information
Sage Weil committed Aug 2, 2010
1 parent dbd379b commit fd4eb66
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb170a22153730eb9c82b6c85ead2001dba6c41a
refs/heads/master: 154f42c2c3c3b66a7a63dad5648e8a9860a32af9
14 changes: 12 additions & 2 deletions trunk/fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2573,7 +2573,8 @@ static void handle_cap_trunc(struct inode *inode,
* caller holds s_mutex
*/
static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
struct ceph_mds_session *session)
struct ceph_mds_session *session,
int *open_target_sessions)
{
struct ceph_inode_info *ci = ceph_inode(inode);
int mds = session->s_mds;
Expand Down Expand Up @@ -2605,6 +2606,12 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
ci->i_cap_exporting_mds = mds;
ci->i_cap_exporting_mseq = mseq;
ci->i_cap_exporting_issued = cap->issued;

/*
* make sure we have open sessions with all possible
* export targets, so that we get the matching IMPORT
*/
*open_target_sessions = 1;
}
__ceph_remove_cap(cap);
}
Expand Down Expand Up @@ -2680,6 +2687,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
u64 size, max_size;
u64 tid;
void *snaptrace;
int open_target_sessions = 0;

dout("handle_caps from mds%d\n", mds);

Expand Down Expand Up @@ -2731,7 +2739,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
goto done;

case CEPH_CAP_OP_EXPORT:
handle_cap_export(inode, h, session);
handle_cap_export(inode, h, session, &open_target_sessions);
goto done;

case CEPH_CAP_OP_IMPORT:
Expand Down Expand Up @@ -2778,6 +2786,8 @@ void ceph_handle_caps(struct ceph_mds_session *session,
done_unlocked:
if (inode)
iput(inode);
if (open_target_sessions)
ceph_mdsc_open_export_target_sessions(mdsc, session);
return;

bad:
Expand Down
8 changes: 8 additions & 0 deletions trunk/fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,14 @@ static void __open_export_target_sessions(struct ceph_mds_client *mdsc,
}
}

void ceph_mdsc_open_export_target_sessions(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session)
{
mutex_lock(&mdsc->mutex);
__open_export_target_sessions(mdsc, session);
mutex_unlock(&mdsc->mutex);
}

/*
* session caps
*/
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/ceph/mds_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,7 @@ extern void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
extern void ceph_mdsc_handle_map(struct ceph_mds_client *mdsc,
struct ceph_msg *msg);

extern void ceph_mdsc_open_export_target_sessions(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session);

#endif

0 comments on commit fd4eb66

Please sign in to comment.