diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 55ec82eaa2d16a57b8488676029cd9dd952fd49d..98554dd18a7157619c2b5f85c751b4dd88c7311a 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -605,12 +605,14 @@ extern void nfs4_test_session_trunk(struct rpc_clnt *clnt,
 
 static inline struct inode *nfs_igrab_and_active(struct inode *inode)
 {
-	inode = igrab(inode);
-	if (inode != NULL && !nfs_sb_active(inode->i_sb)) {
-		iput(inode);
-		inode = NULL;
+	struct super_block *sb = inode->i_sb;
+
+	if (sb && nfs_sb_active(sb)) {
+		if (igrab(inode))
+			return inode;
+		nfs_sb_deactive(sb);
 	}
-	return inode;
+	return NULL;
 }
 
 static inline void nfs_iput_and_deactive(struct inode *inode)