alibaba/ali_kernel — pull request #33 by 4tar (2013-11-21 07:31:27+00:00)
Title: 2 hotfixes from AI environment

Sorry, there are 2 fixes in this request. One is for VLAN creation in no-root namespace, which is included in commit 4e66b31 and involves only 1 file changed (net/core/dev.c), another is for netpoll function enabling for bridge or bonding device, which is included in commit 7a38d52 and involves 2 file changed (drivers/net/bonding/bond_main.c and net/bridge/br_device.c).

For the VLAN one, the modifcation just simply detects whether the device being created is a 8021q one, if so, gives the green light to it, else returns -EPERM to stop the procedure.

For the netpoll one, current implementation prevents the netpoll function from being enabled for a specific device, if it is a bridge with one port which doesn't support netpoll, or a bonding device with one slave which doesn't support netpoll. That means in AI env, after we have already created instance, we wouldn't failed to enable netpoll on the network interface. However, it really seems no sense since the netpoll function pointer would alwayws be checked during runtime before placing a call to it. So in this patch, the logic has been changed to prevent the netpoll function from being enabled only when none port or slave belonging to the specific bridge or bonding device supports netpoll, otherwise, it would say OK to let go.