[Sheepdog] [PATCH 0/2] fix collie command errors during node member changes

Liu Yuan namei.unix at gmail.com
Sat Dec 17 09:39:56 CET 2011


On 12/16/2011 09:20 PM, Liu Yuan wrote:

> On 12/16/2011 08:11 PM, Chris Webb wrote:
> 
>> Perhaps something like this would fit the bill?
>>
> 
> 
> Acked-by: Liu Yuan <tailai.ly at taobao.com>
> 
>> -- >8 --
>> Subject: [PATCH] Don't report an error for blocks not stored locally
>>     
>> Signed-off-by: Chris Webb <chris at arachsys.com>
>> ---
>>  sheep/simple_store.c |    8 +++++---
>>  1 files changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/sheep/simple_store.c b/sheep/simple_store.c
>> index 424589f..3f2c241 100644
>> --- a/sheep/simple_store.c
>> +++ b/sheep/simple_store.c
>> @@ -76,17 +76,19 @@ static int simple_store_open(uint64_t oid, struct siocb *iocb, int create)
>>  
>>  	ret = open(path.buf, flags, def_fmode);
>>  	if (ret < 0) {
>> -		eprintf("failed to open %s: %m\n", path.buf);
>>  		if (errno == ENOENT) {
>>  			struct stat s;
>>  
>> -			ret = SD_RES_NO_OBJ;
>>  			if (stat(obj_path, &s) < 0) {
>>  				/* store directory is corrupted */
>> -				eprintf("corrupted\n");
>> +				eprintf("store directory corrupted: %m\n");
>>  				ret = SD_RES_EIO;
>> +			} else {
>> +				dprintf("object %08u/%016" PRIx64 " not found locally\n", iocb->epoch, oid);
>> +				ret = SD_RES_NO_OBJ;
>>  			}
>>  		} else
>> +			eprintf("failed to open %s: %m\n", path.buf);


need { for else clause?

>>  			ret = SD_RES_UNKNOWN;
>>  		goto out;
>>  	}
> 
> 





More information about the sheepdog mailing list