diff options
Diffstat (limited to 'fs/ceph/mds_client.c')
| -rw-r--r-- | fs/ceph/mds_client.c | 14 | 
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index a5a735422aa..9165eb8309e 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1590,7 +1590,7 @@ static int set_request_path_attr(struct inode *rinode, struct dentry *rdentry,  	} else if (rpath || rino) {  		*ino = rino;  		*ppath = rpath; -		*pathlen = strlen(rpath); +		*pathlen = rpath ? strlen(rpath) : 0;  		dout(" path %.*s\n", *pathlen, rpath);  	} @@ -1876,9 +1876,14 @@ finish:  static void __wake_requests(struct ceph_mds_client *mdsc,  			    struct list_head *head)  { -	struct ceph_mds_request *req, *nreq; +	struct ceph_mds_request *req; +	LIST_HEAD(tmp_list); + +	list_splice_init(head, &tmp_list); -	list_for_each_entry_safe(req, nreq, head, r_wait) { +	while (!list_empty(&tmp_list)) { +		req = list_entry(tmp_list.next, +				 struct ceph_mds_request, r_wait);  		list_del_init(&req->r_wait);  		__do_request(mdsc, req);  	} @@ -2625,7 +2630,8 @@ static void check_new_map(struct ceph_mds_client *mdsc,  		     ceph_mdsmap_is_laggy(newmap, i) ? " (laggy)" : "",  		     session_state_name(s->s_state)); -		if (memcmp(ceph_mdsmap_get_addr(oldmap, i), +		if (i >= newmap->m_max_mds || +		    memcmp(ceph_mdsmap_get_addr(oldmap, i),  			   ceph_mdsmap_get_addr(newmap, i),  			   sizeof(struct ceph_entity_addr))) {  			if (s->s_state == CEPH_MDS_SESSION_OPENING) {  |