[Ocfs2-tools-devel] [PATCH 9/9] ocfs2_controld: Notify dlm_controld when we have a node go down.

Mark Fasheh mfasheh at suse.com
Wed Aug 13 23:10:30 PDT 2008


On Wed, Aug 13, 2008 at 10:57:46PM -0700, Joel Becker wrote:
> On Wed, Aug 13, 2008 at 06:56:16PM -0700, Mark Fasheh wrote:
> > > +void dlmcontrol_node_down(const char *name, int nodeid)
> > > +{
> > > +	int rc;
> > > +	struct dlmcontrol_fs *df;
> > > +	struct dlmcontrol_notification *dn;
> > > +
> > > +	df = find_fs(name);
> > > +	if (!df) {
> > > +		log_error("Name \"%s\" is unknown", name);
> > > +		return;
> > > +	}
> > > +
> > > +	dn = find_notification(df, nodeid);
> > > +	if (!dn) {
> > > +		dn = malloc(sizeof(struct dlmcontrol_notification));
> > > +		if (!dn) {
> > > +			log_error("Unable to allocate memory");
> > > +			goto fail;
> > > +		}
> > > +		dn->dn_nodeid = nodeid;
> > > +		list_add(&dn->dn_list, &df->df_notifications);
> > > +	}
> > > +
> > > +	log_debug("Sending notification of node %d for \"%s\"",
> > > +		  dn->dn_nodeid, df->df_name);
> > > +	rc = dlmc_fs_notified(dlmcontrol_fd, df->df_name, dn->dn_nodeid);
> > 
> > Is dlmc_fs_notified() itself also fire and forget? Can we get into a
> > situation where it'll take us to notify_result(), which will in turn call it
> > again, which will in turn call notify_result, etc until we've eaten up a
> > whole lot of stack...
> 
> 	I see what you mean.  We're safe here.  dlmc_fs_notified() sends
> the notify message to dlm_controld, but does not process any replies.
> It won't recurse.  We pop back out to main.c:loop(), and can only get
> notify_result() after a poll event.

Oh, excellent.

Signed-off-by: Mark Fasheh <mfasheh at suse.com>

--
Mark Fasheh



More information about the Ocfs2-tools-devel mailing list