Merge branch 'for-3.20/bdi' of git://git.kernel.dk/linux-block
[linux-drm-fsl-dcu.git] / fs / nfs / super.c
index 6ec4fe23b756b98115a0a6064e475fa3659635fe..322b2de02988fa6479c2d2831a5e5d70dfdad7c9 100644 (file)
@@ -404,12 +404,15 @@ void __exit unregister_nfs_fs(void)
        unregister_filesystem(&nfs_fs_type);
 }
 
-void nfs_sb_active(struct super_block *sb)
+bool nfs_sb_active(struct super_block *sb)
 {
        struct nfs_server *server = NFS_SB(sb);
 
-       if (atomic_inc_return(&server->active) == 1)
-               atomic_inc(&sb->s_active);
+       if (!atomic_inc_not_zero(&sb->s_active))
+               return false;
+       if (atomic_inc_return(&server->active) != 1)
+               atomic_dec(&sb->s_active);
+       return true;
 }
 EXPORT_SYMBOL_GPL(nfs_sb_active);