Re: [PATCH 2/4] NFS: Properly sort TEST_STATEID results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jun 1, 2012, at 12:01 PM, Myklebust, Trond wrote:

> On Fri, 2012-06-01 at 11:38 -0400, Chuck Lever wrote:
>> 
>> @@ -1740,9 +1748,19 @@ static int nfs41_check_expired_stateid(struct nfs4_state *state, nfs4_stateid *s
>> 
>> 	if (state->flags & flags) {
>> 		status = nfs41_test_stateid(server, stateid);
>> -		if (status != NFS_OK) {
>> +		switch (status) {
>> +		case NFS_OK:
>> +			/* server recognizes this one, don't re-open */
>> +			break;
>> +		case -NFS4ERR_ADMIN_REVOKED:
>> +		case -NFS4ERR_DELEG_REVOKED:
>> +			/* state was revoked, free then re-open */
>> 			nfs41_free_stateid(server, stateid);
>> 			state->flags &= ~flags;
>> +			break;
>> +		default:
> 
> Please don't add empty "default:" cases. 
> 
>> +			/* anything else: go ahead and re-open it */
>> +			break;
> 
> That last "break" is unnecessary too in standard C99.

OK, all fixed for next version.  I'll wait for additional comments before reposting.

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux