[sheepdog] [PATCH v3 2/4] sheep: add new operation flush() to store_driver

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Sep 6 08:56:37 CEST 2012


At Wed,  5 Sep 2012 23:31:03 +0900,
Hitoshi Mitake wrote:
> +int default_flush(void)
> +{
> +	int fd;
> +
> +	if (sys->gateway_only)
> +		return SD_RES_SUCCESS;
> +
> +	fd = open(obj_path, O_RDONLY);
> +	if (fd < 0) {
> +		eprintf("error at open() %s, %s\n", obj_path, strerror(errno));
> +		return SD_RES_NO_OBJ;
> +	}
> +
> +	if (syncfs(fd)) {
> +		eprintf("error at syncfs(), %s\n", strerror(errno));
> +		return SD_RES_EIO;

Close fd on the error path, too.

Thanks,

Kazutaka



More information about the sheepdog mailing list