From: Nikolay Aleksandrov <nikolay@redhat.com>
To: netdev@vger.kernel.org
Cc: vfalico@gmail.com, j.vosburgh@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Nikolay Aleksandrov <nikolay@redhat.com>
Subject: [RFC net-next 3/5] bonding: procfs: clean bond->lock usage and use RTNL
Date: Fri, 5 Sep 2014 20:16:49 +0200 [thread overview]
Message-ID: <1409941011-5494-4-git-send-email-nikolay@redhat.com> (raw)
In-Reply-To: <1409941011-5494-1-git-send-email-nikolay@redhat.com>
Use RTNL because bond->primary_slave might change otherwise.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_procfs.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index de62c0385dfb..eee937afe94e 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -7,7 +7,6 @@
static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(RCU)
- __acquires(&bond->lock)
{
struct bonding *bond = seq->private;
struct list_head *iter;
@@ -15,8 +14,8 @@ static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
loff_t off = 0;
/* make sure the bond won't be taken away */
+ rtnl_lock();
rcu_read_lock();
- read_lock(&bond->lock);
if (*pos == 0)
return SEQ_START_TOKEN;
@@ -53,13 +52,10 @@ static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void bond_info_seq_stop(struct seq_file *seq, void *v)
- __releases(&bond->lock)
__releases(RCU)
{
- struct bonding *bond = seq->private;
-
- read_unlock(&bond->lock);
rcu_read_unlock();
+ rtnl_unlock();
}
static void bond_info_show_master(struct seq_file *seq)
--
1.9.3
next prev parent reply other threads:[~2014-09-05 18:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 18:16 [RFC net-next 0/5] bonding: get rid of bond->lock Nikolay Aleksandrov
2014-09-05 18:16 ` [RFC net-next 1/5] bonding: 3ad: use curr_slave_lock instead " Nikolay Aleksandrov
2014-09-05 20:37 ` Jay Vosburgh
2014-09-05 21:00 ` Nikolay Aleksandrov
2014-09-06 1:08 ` Jay Vosburgh
2014-09-06 10:19 ` Nikolay Aleksandrov
2014-09-05 18:16 ` [RFC net-next 2/5] bonding: alb: clean bond->lock Nikolay Aleksandrov
2014-09-05 18:16 ` Nikolay Aleksandrov [this message]
2014-09-05 18:16 ` [RFC net-next 4/5] bonding: options: remove bond->lock usage Nikolay Aleksandrov
2014-09-05 18:16 ` [RFC net-next 5/5] bonding: remove last users of bond->lock and bond->lock itself Nikolay Aleksandrov
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=1409941011-5494-4-git-send-email-nikolay@redhat.com \
--to=nikolay@redhat.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=j.vosburgh@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).