From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:47624 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726385AbeLDPNd (ORCPT ); Tue, 4 Dec 2018 10:13:33 -0500 Date: Tue, 4 Dec 2018 07:13:32 -0800 From: Christoph Hellwig To: Amir Goldstein Cc: Dave Chinner , linux-fsdevel , linux-xfs , Olga Kornievskaia , Linux NFS Mailing List , overlayfs , ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org Subject: Re: [PATCH 01/11] vfs: copy_file_range source range over EOF should fail Message-ID: <20181204151332.GA32245@infradead.org> References: <20181203083416.28978-1-david@fromorbit.com> <20181203083416.28978-2-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Dec 03, 2018 at 02:46:20PM +0200, Amir Goldstein wrote: > > From: Dave Chinner > > > > The man page says: > > > > EINVAL Requested range extends beyond the end of the source file > > > > But the current behaviour is that copy_file_range does a short > > copy up to the source file EOF. Fix the kernel behaviour to match > > the behaviour described in the man page. I think the behavior implemented is a lot more useful than the one documented.. > > + /* If the source range crosses EOF, fail the copy */ > > + if (pos_in >= i_size(inode_in) || pos_in + len > i_size(inode_in)) > > + return -EINVAL; > > + > > i_size_read()... > > Otherwise > Reviewed-by: Amir Goldstein Looks like this doesn't even compile?