Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322027
b: refs/heads/master
c: 476ad15
h: refs/heads/master
i:
  322025: 34b8eb6
  322023: 9c6d5d1
v: v3
  • Loading branch information
John Fastabend authored and David S. Miller committed Aug 16, 2012
1 parent 8f25f66 commit 69bf783
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 48a87cc26c13b68f6cce4e9d769fcb17a6b3e4b8
refs/heads/master: 476ad154f3b41dd7d9a08a2f641e28388abc2fd1
8 changes: 3 additions & 5 deletions trunk/net/core/netprio_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,10 @@ static int write_update_netdev_table(struct net_device *dev)
u32 max_len;
struct netprio_map *map;

rtnl_lock();
max_len = atomic_read(&max_prioidx) + 1;
map = rtnl_dereference(dev->priomap);
if (!map || map->priomap_len < max_len)
ret = extend_netdev_table(dev, max_len);
rtnl_unlock();

return ret;
}
Expand Down Expand Up @@ -256,17 +254,17 @@ static int write_priomap(struct cgroup *cgrp, struct cftype *cft,
if (!dev)
goto out_free_devname;

rtnl_lock();
ret = write_update_netdev_table(dev);
if (ret < 0)
goto out_put_dev;

rcu_read_lock();
map = rcu_dereference(dev->priomap);
map = rtnl_dereference(dev->priomap);
if (map)
map->priomap[prioidx] = priority;
rcu_read_unlock();

out_put_dev:
rtnl_unlock();
dev_put(dev);

out_free_devname:
Expand Down

0 comments on commit 69bf783

Please sign in to comment.