[sheepdog] [PATCH v4 2/2] sheep: implement atomic create and write mechanism for config

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Apr 17 07:06:11 CEST 2013


At Wed, 17 Apr 2013 11:05:26 +0800,
Liu Yuan wrote:
> 
> On 04/16/2013 05:04 PM, Hitoshi Mitake wrote:
> > +	ret = rename(tmp_config_path, config_path);
> > +	if (ret < 0) {
> > +		sd_eprintf("failed to rename, %m");
> > +		ret = SD_RES_EIO;
> > +	}
> > +
> > +	unlink(tmp_config_path);
> 
> rename already implies unlink() the old dentry. unlink(tmp_config_path)
> isn't necessary.

Oops, sorry for the silly bug. Thanks for your catching.
Hitoshi



More information about the sheepdog mailing list