[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20131202.133348.1105868057685866767.davem@davemloft.net>
Date: Mon, 02 Dec 2013 13:33:48 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: bhutchings@...arflare.com
Cc: carolyn.wyborny@...el.com, jeffrey.t.kirsher@...el.com,
netdev@...r.kernel.org, gospo@...hat.com, sassmann@...hat.com
Subject: Re: [net 1/8] igb: Update queue reinit function to call dev_close
when init of queues fails
From: Ben Hutchings <bhutchings@...arflare.com>
Date: Mon, 2 Dec 2013 17:18:16 +0000
> David is saying that you should implement the reconfiguration in such a
> way that you can always roll back to the previous working state in case
> of a failure (which would make my concerns moot). This is definitely a
> good goal but I'm not convinced that it's always possible.
In this case it is always possible.
The only failure possible in these code paths is for a memory
allocation failure. Therefore, without a doubt, trying to allocate
the memory first before making any changes will provably allow perfect
rollback to a working state. In fact, no state will be changed at all
if the allocation fails.
That's the whole point of my suggestion. Do the one thing that
can fail, the memory allocation, before adjusting anything else.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists