From 75a3dabe66a9fbc232b05e2f744ad5b867e18262 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 22 Feb 2012 15:57:46 -0500 Subject: [PATCH] libafs: retry retriable RPCs instead of abandoning if we get e.g. an idle dead error we should retry retriable actions, namely data stores. in order for writing files to work correctly given how the writeback code is structured it's important that this not interfere with analyze's shouldRetry decision on those RPCs Change-Id: Ie091a72b924c8414ec66c377fa13da14575a69cf Reviewed-on: http://gerrit.openafs.org/6749 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/afs_analyze.c | 7 +++++-- src/afs/afs_stats.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/afs/afs_analyze.c b/src/afs/afs_analyze.c index 2f6e4003e1..859998ab7f 100644 --- a/src/afs/afs_analyze.c +++ b/src/afs/afs_analyze.c @@ -319,9 +319,12 @@ afs_ClearStatus(struct VenusFid *afid, int op, struct volume *avp) } else { ReleaseReadLock(&afs_xvcache); } + if (!avp) + afs_PutVolume(tvp, READ_LOCK); } - if (!avp) - afs_PutVolume(tvp, READ_LOCK); + + if (AFS_STATS_FS_RPCIDXES_WRITE_RETRIABLE(op)) + return 1; /* not retriable: we may have raced ourselves */ return 0; diff --git a/src/afs/afs_stats.h b/src/afs/afs_stats.h index 37b9aad7b4..6e46bffc76 100644 --- a/src/afs/afs_stats.h +++ b/src/afs/afs_stats.h @@ -870,6 +870,7 @@ struct afs_stats_CMPerf { #define AFS_STATS_NUM_FS_RPC_OPS 29 #define AFS_STATS_FS_RPCIDXES_ISWRITE(X) (((X > AFS_STATS_FS_RPCIDX_FETCHSTATUS) && (X < AFS_STATS_FS_RPCIDX_GETSTATISTICS)) || (X == AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS)) +#define AFS_STATS_FS_RPCIDXES_WRITE_RETRIABLE(X) ((X >= AFS_STATS_FS_RPCIDX_STOREDATA) && (X <= AFS_STATS_FS_RPCIDX_STORESTATUS)) #define AFS_STATS_FS_XFERIDX_FETCHDATA 0 #define AFS_STATS_FS_XFERIDX_STOREDATA 1