Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6-microblaze.git] / fs / nfs / dns_resolve.c
index 89bd558..e87d500 100644 (file)
@@ -39,7 +39,6 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
 #include <linux/string.h>
 #include <linux/kmod.h>
 #include <linux/slab.h>
-#include <linux/module.h>
 #include <linux/socket.h>
 #include <linux/seq_file.h>
 #include <linux/inet.h>
@@ -152,12 +151,13 @@ static int nfs_dns_upcall(struct cache_detail *cd,
                struct cache_head *ch)
 {
        struct nfs_dns_ent *key = container_of(ch, struct nfs_dns_ent, h);
-       int ret;
 
-       ret = nfs_cache_upcall(cd, key->hostname);
-       if (ret)
-               ret = sunrpc_cache_pipe_upcall(cd, ch);
-       return ret;
+       if (test_and_set_bit(CACHE_PENDING, &ch->flags))
+               return 0;
+       if (!nfs_cache_upcall(cd, key->hostname))
+               return 0;
+       clear_bit(CACHE_PENDING, &ch->flags);
+       return sunrpc_cache_pipe_upcall_timeout(cd, ch);
 }
 
 static int nfs_dns_match(struct cache_head *ca,