]> git.karo-electronics.de Git - linux-beck.git/commitdiff
exportfs: eliminate unused "noprogress" counter
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 17 Oct 2013 01:20:19 +0000 (21:20 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 Nov 2013 05:16:37 +0000 (00:16 -0500)
Note this counter is now being set to 0 on every pass through the loop,
so it no longer serves any useful purpose.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/exportfs/expfs.c

index 6b5ddd5492bc8320d4389bc27e5f72f9d6d19a87..d8ba88ac10e56dc0d748c0fe4bea57e750c7c92f 100644 (file)
@@ -145,18 +145,9 @@ static void clear_disconnected(struct dentry *dentry)
 static int
 reconnect_path(struct vfsmount *mnt, struct dentry *target_dir, char *nbuf)
 {
-       int noprogress = 0;
        int err = -ESTALE;
 
-       /*
-        * It is possible that a confused file system might not let us complete
-        * the path to the root.  For example, if get_parent returns a directory
-        * in which we cannot find a name for the child.  While this implies a
-        * very sick filesystem we don't want it to cause knfsd to spin.  Hence
-        * the noprogress counter.  If we go through the loop 10 times (2 is
-        * probably enough) without getting anywhere, we just give up
-        */
-       while (target_dir->d_flags & DCACHE_DISCONNECTED && noprogress++ < 10) {
+       while (target_dir->d_flags & DCACHE_DISCONNECTED) {
                struct dentry *pd = find_disconnected_root(target_dir);
 
                BUG_ON(pd == mnt->mnt_sb->s_root);
@@ -230,9 +221,7 @@ reconnect_path(struct vfsmount *mnt, struct dentry *target_dir, char *nbuf)
                         */
                        dput(npd);
                        dput(ppd);
-                       if (npd == pd)
-                               noprogress = 0;
-                       else
+                       if (npd != pd)
                                goto out_reconnected;
                        if (IS_ROOT(pd)) {
                                /* something went wrong, we have to give up */