Linux wireless drivers development
 help / color / mirror / Atom feed
From: Bob Copeland <me@bobcopeland.com>
To: Henning Rogge <hrogge@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>,
	"David S. Miller" <davem@davemloft.net>,
	Henning Rogge <henning.rogge@fkie.fraunhofer.de>
Subject: Re: [PATCH v2 3/3] mac80211: Unify mesh and mpp path removal function
Date: Sat, 30 Jan 2016 18:37:32 -0500	[thread overview]
Message-ID: <20160130233732.GA1507@localhost> (raw)
In-Reply-To: <1454062138-18012-4-git-send-email-henning.rogge@fkie.fraunhofer.de>

On Fri, Jan 29, 2016 at 11:08:58AM +0100, Henning Rogge wrote:
> mpp_path_del() and mesh_path_del() are mostly the same function.
> Move common code into a new static function.
> 
> Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
> ---
>  net/mac80211/mesh_pathtbl.c | 110 ++++++++++++++++++++++----------------------
>  1 file changed, 55 insertions(+), 55 deletions(-)
> 
> diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
> index 33bb1f25..86316ee 100644
> --- a/net/mac80211/mesh_pathtbl.c
> +++ b/net/mac80211/mesh_pathtbl.c
> @@ -55,16 +55,20 @@ int mpp_paths_generation;
>  static DEFINE_RWLOCK(pathtbl_resize_lock);
>  
>  
> +static inline struct mesh_table *resize_dereference_paths(struct mesh_table *table)

0-day caught this -- the parameter should be "struct mesh_table __rcu *table"

You can install sparse, set CONFIG_SPARSE_RCU_POINTER=y and then check it
with something like:

        make C=2 M=net/mac80211

The code is ok but the annotation catches cases where a dereference
would happen without the right lock -- in this case pathtable resize
lock is held.

> +{
> +  return rcu_dereference_protected(table,
> +    lockdep_is_held(&pathtbl_resize_lock));
> +}
> +

Besides that though, something is wrong with whitespace throughout
the patch, looks like lots of 2-space indents instead of tabs.

Approach looks fine though.  I might've moved the resize lock into
table_path_del, but it doesn't really matter as I plan to replace
with rhashtable anyway.

-- 
Bob Copeland %% http://bobcopeland.com/

  parent reply	other threads:[~2016-01-30 23:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 10:08 [PATCH v2 0/3] mac80211: add cleanup path for MPP table entries Henning Rogge
2016-01-29 10:08 ` [PATCH v2 1/3] mac80211: Remove MPP table entries with MPath Henning Rogge
2016-01-29 10:08 ` [PATCH v2 2/3] mac80211: let unused MPP table entries timeout Henning Rogge
2016-01-29 10:08 ` [PATCH v2 3/3] mac80211: Unify mesh and mpp path removal function Henning Rogge
2016-01-29 12:08   ` kbuild test robot
2016-01-30 23:37   ` Bob Copeland [this message]
2016-01-30 23:56   ` Bob Copeland
2016-01-31  7:30     ` Henning Rogge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160130233732.GA1507@localhost \
    --to=me@bobcopeland.com \
    --cc=davem@davemloft.net \
    --cc=henning.rogge@fkie.fraunhofer.de \
    --cc=hrogge@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox