exportfs: BUG_ON in crazy corner case
authorChristoph Hellwig <hch@lst.de>
Wed, 16 Oct 2013 19:48:53 +0000 (15:48 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 9 Nov 2013 05:16:35 +0000 (00:16 -0500)
This would indicate a nasty bug in the dcache and has never triggered in
the past 10 years as far as I know.

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 c43fe9b39ff2dc366e8e26f9d2806b93bb28a2e7..6d0a7fa9abb3010141f5407e465296645b83855f 100644 (file)
@@ -112,18 +112,14 @@ reconnect_path(struct vfsmount *mnt, struct dentry *target_dir, char *nbuf)
        while (target_dir->d_flags & DCACHE_DISCONNECTED && noprogress++ < 10) {
                struct dentry *pd = find_disconnected_root(target_dir);
 
+               BUG_ON(pd == mnt->mnt_sb->s_root);
+
                if (!IS_ROOT(pd)) {
                        /* must have found a connected parent - great */
                        spin_lock(&pd->d_lock);
                        pd->d_flags &= ~DCACHE_DISCONNECTED;
                        spin_unlock(&pd->d_lock);
                        noprogress = 0;
-               } else if (pd == mnt->mnt_sb->s_root) {
-                       printk(KERN_ERR "export: Eeek filesystem root is not connected, impossible\n");
-                       spin_lock(&pd->d_lock);
-                       pd->d_flags &= ~DCACHE_DISCONNECTED;
-                       spin_unlock(&pd->d_lock);
-                       noprogress = 0;
                } else {
                        /*
                         * We have hit the top of a disconnected path, try to