[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150324.131105.1048577882668644719.davem@davemloft.net>
Date: Tue, 24 Mar 2015 13:11:05 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: xiyou.wangcong@...il.com
Cc: netdev@...r.kernel.org, stephen@...workplumber.org
Subject: Re: [Patch net-next] net: allow to delete a whole device group
From: Cong Wang <xiyou.wangcong@...il.com>
Date: Mon, 23 Mar 2015 17:04:15 -0700
> + for_each_netdev_safe(net, dev, aux) {
> + if (dev->group == group) {
> + const struct rtnl_link_ops *ops;
> +
> + found = true;
> + ops = dev->rtnl_link_ops;
> + if (!ops || !ops->dellink)
> + return -EOPNOTSUPP;
> + ops->dellink(dev, &list_kill);
> + }
These semantics are terrible.
A netlink request should always strive (no, I'll say it _must_) either
fully perform the requested operation for all relevant objects, or
have no side effects and return an error.
If need be you must completely unwind all partial changes before
returning that error, or alternatively defer commiting the
changes until you can guarantee that all of them can be performed.
--
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