9p: don't forget to destroy inode cache if fscache registration fails
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 17 Sep 2013 12:10:18 +0000 (08:10 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 18 Sep 2013 02:31:01 +0000 (22:31 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/9p/v9fs.c

index 58e6cbce4156fb37a9820297e3a35c83d3524e81..08f2e1e9a7e6a4b66d08ea92e5ddf834dcb9d4a4 100644 (file)
@@ -603,10 +603,11 @@ static int v9fs_cache_register(void)
        if (ret < 0)
                return ret;
 #ifdef CONFIG_9P_FSCACHE
-       return fscache_register_netfs(&v9fs_cache_netfs);
-#else
-       return ret;
+       ret = fscache_register_netfs(&v9fs_cache_netfs);
+       if (ret < 0)
+               v9fs_destroy_inode_cache();
 #endif
+       return ret;
 }
 
 static void v9fs_cache_unregister(void)