Implement a retry mechanism in the identity cache in case the
identity up call times out.
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Ib70d3b851a6da3cf66dfed49b03be51da7886d01
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48579
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
__u64 key, void *args)
{
struct upcall_cache_entry *entry = NULL, *new = NULL, *next;
+ bool failedacquiring = false;
struct list_head *head;
wait_queue_entry_t wait;
int rc, found;
CERROR("acquire for key %llu: error %d\n",
entry->ue_key, rc);
put_entry(cache, entry);
+ if (!failedacquiring) {
+ spin_unlock(&cache->uc_lock);
+ failedacquiring = true;
+ new = NULL;
+ goto find_again;
+ }
GOTO(out, entry = ERR_PTR(rc));
}
}
glob_t path;
unsigned long uid;
int fd, rc = -EINVAL, size, maxgroups;
+ bool alreadyfailed = false;
progname = basename(argv[0]);
if (argc != 3) {
goto out;
}
+retry:
size = offsetof(struct identity_downcall_data, idd_groups[maxgroups]);
data = malloc(size);
if (!data) {
errlog("malloc identity downcall data(%d) failed!\n", size);
+ if (!alreadyfailed) {
+ alreadyfailed = true;
+ goto retry;
+ }
rc = -ENOMEM;
goto out;
}
close(fd);
if (rc != size) {
errlog("partial write ret %d: %s\n", rc, strerror(errno));
+ if (!alreadyfailed) {
+ alreadyfailed = true;
+ cfs_free_param_data(&path);
+ if (data)
+ free(data);
+ goto retry;
+ }
rc = -1;
} else {
rc = 0;