From patchwork Mon Mar 25 04:10:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tingwei Liu X-Patchwork-Id: 230572 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 760C22C0098 for ; Mon, 25 Mar 2013 15:12:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752784Ab3CYELB (ORCPT ); Mon, 25 Mar 2013 00:11:01 -0400 Received: from mail-ia0-f173.google.com ([209.85.210.173]:61300 "EHLO mail-ia0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611Ab3CYEKw (ORCPT ); Mon, 25 Mar 2013 00:10:52 -0400 Received: by mail-ia0-f173.google.com with SMTP id h37so5178591iak.18 for ; Sun, 24 Mar 2013 21:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=67wN1XwkjF2E/h6Medju+5y9/DKcivTX0rXEbLQx+L0=; b=ZpXZa3286c1cut2VuBd7ndVyehS2Q0hH8LEoBE9k32q1XPVRxKILQRDCkE7jbFp2eR mHSJ8j3XIHkW8nCoDS0xQ5JxMMWgNLPzDSInKMSn4pM+R/Yu9dsqkVttElnlCYi+dlV+ HBrjnXz31gqXLC8IXEnueMQPgkChR5/b2ywlAcrZ1RylDcJU4HwusG6OcnHJa0j4Z2UJ /YoK9DOXjdx65oqsRUIWJ5T9phKnanLqYRve2XcM/vrV4ydbl8vD6hFG6DB59wG7W4jW o45ygKKlliClmdshY0zHx5ZXYjQcbIyMJ6Ys7NGUkgfBo3UQPuukeiTtg5vsgdvTIG9q fW8Q== MIME-Version: 1.0 X-Received: by 10.50.237.71 with SMTP id va7mr10325866igc.88.1364184652055; Sun, 24 Mar 2013 21:10:52 -0700 (PDT) Received: by 10.42.49.77 with HTTP; Sun, 24 Mar 2013 21:10:51 -0700 (PDT) Date: Mon, 25 Mar 2013 12:10:51 +0800 Message-ID: Subject: [PATCH v2 1/1]core:Change a wrong explain about dev_get_by_name From: tingwei liu To: netdev@vger.kernel.org, Alexey Kuznetsov , davem@davemloft.net, Eric Dumazet , Ben Hutchings , Linus Torvalds Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tingwei Liu Date: Mon, 25 Mar 2013 11:09:59 +0800 Subject: [PATCH] Change a wrong explain about dev_get_by_name a long time ago by the commit. commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Author: Linus Torvalds Date: Sat Apr 16 15:20:36 2005 -0700 Linux-2.6.12-rc2 Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip! When function "list_netdevice" get write lock "dev_base_lock" only disable soft interrupt. So dev_get_by_name get read lock "dev_base_lock", can not called on interrupt context. Signed-off-by: Tingwei Liu --- Changes from v1: - add change log - add the commnet net/core/dev.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) -- 1.6.0.2 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/core/dev.c b/net/core/dev.c index d540ced..20c5c7c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -700,10 +700,10 @@ EXPORT_SYMBOL(dev_get_by_name_rcu); * @name: name to find * * Find an interface by name. This can be called from any - * context and does its own locking. The returned handle has - * the usage count incremented and the caller must use dev_put() to - * release it when it is no longer needed. %NULL is returned if no - * matching device is found. + * context except hard irq context and does its own locking. + * The returned handle has the usage count incremented and the + * caller must use dev_put() to release it when it is no longer + * needed. %NULL is returned if no matching device is found. */ struct net_device *dev_get_by_name(struct net *net, const char *name)