Messages in this thread | | | From | Chris Wulff <> | Subject | Re: [PATCH] configfs: Implement binary attributes (v3) | Date | Sat, 13 Jun 2015 02:06:13 +0000 (UTC) |
| |
Pantelis Antoniou <pantelis.antoniou <at> konsulko.com> writes:
... > +static ssize_t > +configfs_write_bin_file(struct file *file, const char __user *buf, > + size_t count, loff_t *ppos) > +{ ... > + len = simple_write_to_buffer(buffer->bin_buffer, > + buffer->bin_buffer_size, ppos, buf, count); > + if (len > 0) > + *ppos += len; > +out: > + mutex_unlock(&buffer->mutex); > + return len; > +} > + ...
It appears there is a small bug in this code. If you write more than one page worth of data it incorrectly skips ahead. This code should NOT increment ppos as the simple_write_to_buffer call already does that for you.
-- Chris Wulff
| |