From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760068AbcLRD01 (ORCPT ); Sat, 17 Dec 2016 22:26:27 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:38268 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056AbcLRD00 (ORCPT ); Sat, 17 Dec 2016 22:26:26 -0500 Date: Sun, 18 Dec 2016 03:26:12 +0000 From: Al Viro To: Linus Torvalds Cc: Linux Kernel Mailing List , linux-fsdevel , "Darrick J. Wong" Subject: Re: [git pull] vfs.git pile 2 Message-ID: <20161218032605.GW1555@ZenIV.linux.org.uk> References: <20161216221218.GT1555@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Darrick Cc'd] On Sat, Dec 17, 2016 at 06:49:55PM -0800, Linus Torvalds wrote: > On Fri, Dec 16, 2016 at 2:12 PM, Al Viro wrote: > > In this pile: > > * autofs-namespace series > > * dedupe stuff > > * more struct path constification > > When looking at the conflict, I looked at that part of > vfs_clone_file_prep_inodes(), and reacted to the insanity. > > WTF? > > /* Zero length dedupe exits immediately; reflink goes to EOF. */ > if (*len == 0) { > if (is_dedupe) { > *len = 0; > return 0; > } > *len = isize - pos_in; > } > > I'll just leave you to read through that part a bit more. Because > there are two completely insane things going on in that code sequence. One, AFAICS - pointless *len = 0 in case of is_dedupe. That's a counterpart of /* Zero length dedupe exits immediately; reflink goes to EOF. */ if (len == 0) { if (is_dedupe) { ret = 0; goto out_unlock; } len = isize - pos_in; } in mainline xfs_reflink_remap_range(). What else am I missing there? I'm not thrilled with the calling conventions they'd used, and that *len = 0; shouldn't have been slapped there (at a guess, by inertia from the conversion of the chunk right before that one - /* Are we going all the way to the end? */ isize = i_size_read(inode_in); if (isize == 0) { ret = 0; goto out_unlock; } in mainline, needing *len = 0; after conversion), but I don't see what else are you refering to in that snippet...