Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139729
b: refs/heads/master
c: 2c53d91
h: refs/heads/master
i:
  139727: 250af09
v: v3
  • Loading branch information
Aravind Srinivasan authored and Linus Torvalds committed Apr 3, 2009
1 parent 30f0678 commit 6beddfe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: edb79a213223488735fae1d408f4c136e9ed25d6
refs/heads/master: 2c53d9109f077900e140edb8b766132ad93b81cc
8 changes: 5 additions & 3 deletions trunk/kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,13 +797,15 @@ void relay_subbufs_consumed(struct rchan *chan,
if (!chan)
return;

if (cpu >= NR_CPUS || !chan->buf[cpu])
if (cpu >= NR_CPUS || !chan->buf[cpu] ||
subbufs_consumed > chan->n_subbufs)
return;

buf = chan->buf[cpu];
buf->subbufs_consumed += subbufs_consumed;
if (buf->subbufs_consumed > buf->subbufs_produced)
if (subbufs_consumed > buf->subbufs_produced - buf->subbufs_consumed)
buf->subbufs_consumed = buf->subbufs_produced;
else
buf->subbufs_consumed += subbufs_consumed;
}
EXPORT_SYMBOL_GPL(relay_subbufs_consumed);

Expand Down

0 comments on commit 6beddfe

Please sign in to comment.