The loss that you are not able to realize on the sale gets added to the cost basis of the repurchased stock so you'll still get credit for the loss when you sell the repurchased stock. The holding period of the repurchased stock (for determining short-term or long-term capital gains) is inherited from that of the original stock shares.
You should be able to effectively realize the loss in 2017 if you sell the repurchased shares in 2017 as long as you do not repurchase the same shares again within 30 days. You can either buy something else that is not substantially identical or wait beyond the 30-day window to repurchase the shares. (You still have a wash-sale on the original sale and repurchase. You realize the loss on the subsequent sale.)