Back pack should be no problem. The one "sticky" point I have had numerous times is the following (and yes I know it is a yearly bone of contention on this site with so many, but have patience).
I have carried on my back pack out of LAX on Iberia with my poles neatly stashed on the exterior pockets of my pack and have never had a problem going onboard, BUT once I arrived in Madrid for my transfer flight on Iberia I was not allowed to carry them into the cabin (still stashed) in my back pack. I was forced to check in my entire back pack, which took up valuable time to reach my connecting flight.
One would think there would be a company wide policy regarding things of this nature, but no..........
Your best bet, if you're carrying poles, is to call ahead to confirm.
One last thing and as others that stated Barajas Airport is huge and to give you a comparison LAX is very small compared to Barajas.
Enjoy your trip.........