Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276995
b: refs/heads/master
c: 7cc8583
h: refs/heads/master
i:
  276993: 1e6ac86
  276991: afef200
v: v3
  • Loading branch information
David S. Miller committed Dec 22, 2011
1 parent 0ef0c3d commit 1667a03
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 42 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: 155d4551bd0ab04367f4ca4e0a229774497da4d8
refs/heads/master: 7cc8583372a21d98a23b703ad96cab03180b5030
4 changes: 2 additions & 2 deletions trunk/arch/sparc/kernel/pci_sun4v.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,10 +849,10 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm,
if (!irq)
return -ENOMEM;

if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE))
return -EINVAL;
if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID))
return -EINVAL;
if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE))
return -EINVAL;

return irq;
}
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,9 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
atomic_read(&bitmap->behind_writes),
bitmap->mddev->bitmap_info.max_write_behind);
}
if (bitmap->mddev->degraded)
/* Never clear bits or update events_cleared when degraded */
success = 0;

while (sectors) {
sector_t blocks;
Expand All @@ -1406,7 +1409,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
return;
}

if (success && !bitmap->mddev->degraded &&
if (success &&
bitmap->events_cleared < bitmap->mddev->events) {
bitmap->events_cleared = bitmap->mddev->events;
bitmap->need_sync = 1;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
return -EINVAL;

rdev->raid_disk = rdev->saved_raid_disk;
rdev->saved_raid_disk = -1;

newconf = linear_conf(mddev,mddev->raid_disks+1);

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -7360,7 +7360,8 @@ static int remove_and_add_spares(struct mddev *mddev)
spares++;
md_new_event(mddev);
set_bit(MD_CHANGE_DEVS, &mddev->flags);
}
} else
break;
}
}
}
Expand Down
14 changes: 4 additions & 10 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -3065,17 +3065,11 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
}
} else if (test_bit(In_sync, &rdev->flags))
set_bit(R5_Insync, &dev->flags);
else if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
else {
/* in sync if before recovery_offset */
set_bit(R5_Insync, &dev->flags);
else if (test_bit(R5_UPTODATE, &dev->flags) &&
test_bit(R5_Expanded, &dev->flags))
/* If we've reshaped into here, we assume it is Insync.
* We will shortly update recovery_offset to make
* it official.
*/
set_bit(R5_Insync, &dev->flags);

if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
set_bit(R5_Insync, &dev->flags);
}
if (rdev && test_bit(R5_WriteError, &dev->flags)) {
clear_bit(R5_Insync, &dev->flags);
if (!test_bit(Faulty, &rdev->flags)) {
Expand Down
1 change: 0 additions & 1 deletion trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct dst_entry {
#define DST_NOHASH 0x0008
#define DST_NOCACHE 0x0010
#define DST_NOCOUNT 0x0020
#define DST_NOPEER 0x0040

short error;
short obsolete;
Expand Down
4 changes: 1 addition & 3 deletions trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -637,14 +637,12 @@ static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)

/*
* Take into account size of receive queue and backlog queue
* Do not take into account this skb truesize,
* to allow even a single big packet to come.
*/
static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff *skb)
{
unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc);

return qsize > sk->sk_rcvbuf;
return qsize + skb->truesize > sk->sk_rcvbuf;
}

/* The per-socket spinlock must be held here. */
Expand Down
8 changes: 1 addition & 7 deletions trunk/net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,12 @@ static struct neighbour *fake_neigh_lookup(const struct dst_entry *dst, const vo
return NULL;
}

static unsigned int fake_mtu(const struct dst_entry *dst)
{
return dst->dev->mtu;
}

static struct dst_ops fake_dst_ops = {
.family = AF_INET,
.protocol = cpu_to_be16(ETH_P_IP),
.update_pmtu = fake_update_pmtu,
.cow_metrics = fake_cow_metrics,
.neigh_lookup = fake_neigh_lookup,
.mtu = fake_mtu,
};

/*
Expand All @@ -147,7 +141,7 @@ void br_netfilter_rtable_init(struct net_bridge *br)
rt->dst.dev = br->dev;
rt->dst.path = &rt->dst;
dst_init_metrics(&rt->dst, br_dst_default_metrics, true);
rt->dst.flags = DST_NOXFRM | DST_NOPEER;
rt->dst.flags = DST_NOXFRM;
rt->dst.ops = &fake_dst_ops;
}

Expand Down
7 changes: 2 additions & 5 deletions trunk/net/core/net-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,14 +665,11 @@ static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue,
if (count) {
int i;

if (count > INT_MAX)
return -EINVAL;
count = roundup_pow_of_two(count);
if (count > (ULONG_MAX - sizeof(struct rps_dev_flow_table))
/ sizeof(struct rps_dev_flow)) {
if (count > 1<<30) {
/* Enforce a limit to prevent overflow */
return -EINVAL;
}
count = roundup_pow_of_two(count);
table = vmalloc(RPS_DEV_FLOW_TABLE_SIZE(count));
if (!table)
return -ENOMEM;
Expand Down
6 changes: 5 additions & 1 deletion trunk/net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
unsigned long flags;
struct sk_buff_head *list = &sk->sk_receive_queue;

if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) {
/* Cast sk->rcvbuf to unsigned... It's pointless, but reduces
number of warnings when compiling with -W --ANK
*/
if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
(unsigned)sk->sk_rcvbuf) {
atomic_inc(&sk->sk_drops);
trace_sock_rcvqueue_full(sk, skb);
return -ENOMEM;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more)
{
struct rtable *rt = (struct rtable *) dst;

if (rt && !(rt->dst.flags & DST_NOPEER)) {
if (rt) {
if (rt->peer == NULL)
rt_bind_peer(rt, rt->rt_dst, 1);

Expand All @@ -1378,7 +1378,7 @@ void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more)
iph->id = htons(inet_getid(rt->peer, more));
return;
}
} else if (!rt)
} else
printk(KERN_DEBUG "rt_bind_peer(0) @%p\n",
__builtin_return_address(0));

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
static atomic_t ipv6_fragmentation_id;
int old, new;

if (rt && !(rt->dst.flags & DST_NOPEER)) {
if (rt) {
struct inet_peer *peer;

if (!rt->rt6i_peer)
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/netfilter/xt_connbytes.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ connbytes_mt(const struct sk_buff *skb, struct xt_action_param *par)
break;
}

if (sinfo->count.to >= sinfo->count.from)
if (sinfo->count.to)
return what <= sinfo->count.to && what >= sinfo->count.from;
else /* inverted */
return what < sinfo->count.to || what > sinfo->count.from;
else
return what >= sinfo->count.from;
}

static int connbytes_mt_check(const struct xt_mtchk_param *par)
Expand Down
6 changes: 4 additions & 2 deletions trunk/net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,8 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
if (snaplen > res)
snaplen = res;

if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
(unsigned)sk->sk_rcvbuf)
goto drop_n_acct;

if (skb_shared(skb)) {
Expand Down Expand Up @@ -1761,7 +1762,8 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
if (po->tp_version <= TPACKET_V2) {
if (macoff + snaplen > po->rx_ring.frame_size) {
if (po->copy_thresh &&
atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf) {
atomic_read(&sk->sk_rmem_alloc) + skb->truesize
< (unsigned)sk->sk_rcvbuf) {
if (skb_shared(skb)) {
copy_skb = skb_clone(skb, GFP_ATOMIC);
} else {
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/sched/sch_mqprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)
if (!netif_is_multiqueue(dev))
return -EOPNOTSUPP;

if (!opt || nla_len(opt) < sizeof(*qopt))
if (nla_len(opt) < sizeof(*qopt))
return -EINVAL;

qopt = nla_data(opt);
Expand Down

0 comments on commit 1667a03

Please sign in to comment.