netoops啟動時報 "XX is a slave device, aborting&quo

來源:互聯網
上載者:User

為了監控上線的新核心,我們把google的netoopsbackport到了自己的核心,生產上如有kernel panic,會將panic的棧資訊發送到Log Service器,方便調試和修複。


前天,洪川同學報告說以前線上的netoops都是把bond的slave網口作為發訊息的dev,新上線2.6.32-220核心後,啟動netoops失敗,系統報:


”eth0 is a slave device, aborting."


找了一下從 2.6.32-131 到 2.6.32-220 的redhat的變動,發現了王聰同學的這個patch:

 


commit 0c1ad04aecb975f2a2014e1bc5a2fa23923ecbd9
Author: WANG Cong www.2cto.com
Date:   Thu Jun 9 00:28:13 2011 -0700


    netpoll: prevent netpoll setup on slave devices
   
    In commit 8d8fc29d02a33e4bd5f4fa47823c1fd386346093
    (netpoll: disable netpoll when enslave a device), we automatically
    disable netpoll when the underlying device is being enslaved,
    we also need to prevent people from setuping netpoll on
    devices that are already enslaved.
   
    Signed-off-by: WANG Cong <www.2cto.com>
    Signed-off-by: David S. Miller <www.2cto.com>


diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 2d7d6d4..42ea4b0 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -792,6 +792,12 @@ int netpoll_setup(struct netpoll *np)
                return -ENODEV;
        }
 
+       if (ndev->master) {
+               printk(KERN_ERR "%s: %s is a slave device, aborting.\n",
+                      np->name, np->dev_name);
+               return -EBUSY;
+       }
+
        if (!netif_running(ndev)) {
                unsigned long atmost, atleast;
 


從此,netpoll就無法使用slave裝置了(netoops用的就是netpoll),不過我奇怪為什麼以前可以現在又不行了,所以發郵件問了王聰同學為何現在不能使用slave裝置,回答是:


“因為slave裝置沒有IP地址,www.2cto.com”


而且王同學在redhat搞netconsole也遇到了同樣的問題,只能改用master網口。
我們的netoops也只能遵循同樣的規則,統一改用 bond0做dev。
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.