Cognitive dissonance is an uncomfortable feeling caused by holding conflicting ideas simultaneously. The theory of cognitive dissonance proposes that people have a motivational drive to reduce dissonance. They do this by changing their attitudes, beliefs, and actions. Dissonance is also reduced by justifying, blaming, and denying. (http://en.wikipedia.org/wiki/Cognitive_dissonance)
When I was Mormon, I remember having the impression, strongly enforced by what was taught in class, that things that weren't pro-Mormon were of Satan and that's why bad feelings come from them. There's also the idea that things from Satan cause uncomfortable feelings, and while we all know intellectually that that's not always true, it was generally assumed that good feelings about something were from the Spirit, and bad feelings were from Satan.
However, to lump subjective feelings into these categories is to lay a trap for oneself. Good things don't always feel good--no one feels excited or completely warm and fuzzy going into surgery, even if they have peace in knowing that its necessary and assurance that they should come out in better health when all is said and done. This goes the same for beliefs. The existence of evil doesn't make anyone feel happy, but that doesn't mean that it isn't true just because we don't like it. For a Christian, the idea of people going to hell doesn't make us feel great, but that doesn't make the belief untrue. (An atheist or a skeptic might argue that the belief isn't true, but they don't generally use feelings as their primary validation.)
Sometimes, we learn truth accompanied by confusion and discomfort. If I thought one thing, and then was told something else was true, I'm not really going to feel comfortable in learning I might have been wrong. I can then either accept the new information, or reject it, and I can base that decision off of a few things. I can either approach it with logic, reason, and an open mind, looking for the objective truth supported by whatever facts or understanding is available. Or, I can accept the belief most comfortable to me and rationalize it if it is the incorrect belief.
This stands true for researching faith, as well. The ability to question is inherent to our nature, and there is no reason a loving God would deny us use of that ability. That is what a tyrant does. Truth will stand up to questioning, and whether or not we find truth is up to us and how we choose to question, how we choose to perceive what we have learned, and how we choose to find the knowledge. Some sources are biased--the Catholic church probably isn't going to talk to loudly about their shortcomings for instance. Muslim fundamentalists aren't going to admit that what they do destroys innocent lives. Fundamentalist Mormons aren't going to readily jump to admitting to the many kinds of abuse that religious polygamy fosters. And the Mormon church isn't going to admit to shady history or questionable doctrines and prophecies.
That's not to say that all sources are biased, or that every organization, religion, faith, and world-view in the world is completely unable to admit that there are less-than-positive things in their past. That's just to say that it's okay to look to sources outside of your own organization, religion, faith, and world-view to get the whole truth. Careful research can usually pick out the truth from the wild false claims, if the researcher is willing to be objective.
When I first started learning about the false prophecies of Joseph Smith, I had some major cognitive dissonance. I had held Joseph Smith to be a false prophet, and suddenly there were false prophecies in front of me (D&C 84:1-5, for instance) and I couldn't deny that they hadn't happened as promised. I had a few options at that point--twist things around to justify the false prophecies, no matter how much I had to deny reality to do so, or try to justify Joseph Smith in making false prophecies no matter how much I had to twist logic and scripture, or admit that the prophecies were false and that a true prophet does not make false prophecies. I chose the one that made the most sense, and left the church.
That doesn't mean that what I found was automatically from the devil. As I pointed out above, one of the false prophecies that impacted me the most was one found in the standard works...and it didn't happen. It wasn't a bad feeling from Satan, it was a bad feeling because what I had been taught and what I was seeing did not line up with each other.
Don't be afraid to question, and don't be afraid to keep trusting and hoping while you do. You might be surprised where things will take you when you resolve your cognitive dissonance--not Satan's influence--in a logical, reasonable, and prayerful manner.