From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751806AbdH3PhH (ORCPT ); Wed, 30 Aug 2017 11:37:07 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:44744 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbdH3PhG (ORCPT ); Wed, 30 Aug 2017 11:37:06 -0400 Date: Wed, 30 Aug 2017 16:37:04 +0100 From: Al Viro To: Christoph Hellwig Cc: arve@android.com, riandrews@android.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/16] fs: fix kernel_read prototype Message-ID: <20170830153704.GN5426@ZenIV.linux.org.uk> References: <20170830150007.3953-1-hch@lst.de> <20170830150007.3953-6-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170830150007.3953-6-hch@lst.de> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 30, 2017 at 04:59:56PM +0200, Christoph Hellwig wrote: > Use proper ssize_t and size_t types for the return value and count > argument, move the offset last and make it an in/out argument like > all other read/write helpers. Might be better to switch the third argument to void * at the same time and lose those casts. > if (p) > memcpy(p + offset, buf, n); > - > - offset += n; Almost certainly broken - in effect, you've taken the update of offset several lines prior, so that memcpy() is getting the wrong first argument. The same needs to be watched out for in other similar places.