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

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Thu Sep 6 08:57:27 CEST 2012


(2012/09/06 15:56), MORITA Kazutaka wrote:
> 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 for catching. I'll fix this problem in the next patch set.

Thanks,
Hitoshi






More information about the sheepdog mailing list