Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd634fb6 authored by Sage Weil's avatar Sage Weil
Browse files

libceph: subscribe to osdmap when cluster is full



When the cluster is marked full, subscribe to subsequent map updates to
ensure we find out promptly when it is no longer full.  This will prevent
us from spewing ENOSPC for (much) longer than necessary.

Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 7662d8ff
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -1421,6 +1421,15 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
done:
done:
	downgrade_write(&osdc->map_sem);
	downgrade_write(&osdc->map_sem);
	ceph_monc_got_osdmap(&osdc->client->monc, osdc->osdmap->epoch);
	ceph_monc_got_osdmap(&osdc->client->monc, osdc->osdmap->epoch);

	/*
	 * subscribe to subsequent osdmap updates if full to ensure
	 * we find out when we are no longer full and stop returning
	 * ENOSPC.
	 */
	if (ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_FULL))
		ceph_monc_request_next_osdmap(&osdc->client->monc);

	send_queued(osdc);
	send_queued(osdc);
	up_read(&osdc->map_sem);
	up_read(&osdc->map_sem);
	wake_up_all(&osdc->client->auth_wq);
	wake_up_all(&osdc->client->auth_wq);