Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755250AbbFMCKQ (ORCPT ); Fri, 12 Jun 2015 22:10:16 -0400 Received: from plane.gmane.org ([80.91.229.3]:38134 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbbFMCKM (ORCPT ); Fri, 12 Jun 2015 22:10:12 -0400 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Chris Wulff Subject: Re: [PATCH] configfs: Implement binary attributes (v3) Date: Sat, 13 Jun 2015 02:06:13 +0000 (UTC) Message-ID: References: <1414528232-7707-1-git-send-email-pantelis.antoniou@konsulko.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 74.74.198.71 (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 893 Lines: 24 Pantelis Antoniou 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/