From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gummerer Subject: Re: [PATCH] read-cache: tighten checks for do_read_index Date: Tue, 24 Mar 2015 22:51:04 +0100 Message-ID: <20150324215104.GB2006@hank> References: <1427216429-15569-1-git-send-email-t.gummerer@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org, Duy Nguyen , Jaime Soriano Pastor To: Junio C Hamano X-From: git-owner@vger.kernel.org Tue Mar 24 22:51:18 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YaWjC-0002Dt-Pf for gcvg-git-2@plane.gmane.org; Tue, 24 Mar 2015 22:51:15 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752366AbbCXVvK (ORCPT ); Tue, 24 Mar 2015 17:51:10 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:36627 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbbCXVvI (ORCPT ); Tue, 24 Mar 2015 17:51:08 -0400 Received: by wgra20 with SMTP id a20so5498249wgr.3 for ; Tue, 24 Mar 2015 14:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=LoihTJZhxQp9Sx7N1pPiQYDBF42jwi2ac+iNikoKGZs=; b=vpiG+vV00gXQ0Cb/2pPMMXxIBlYuV5fISuLz1aWCTH0CQ4x9/mgKP9vzHAmf/lMLUn QpUwaiaW9m4PUBNxouw2HJDZfmx4CS+0vDDn3TzBaakhJToxHFUR5cFgRY1KkgJgJ905 5jmD1W+KLz0R1HQNB7dT82wx82Q65eo2K+qmRoTuvMyEkdAnFJNwuBUKyhSP2FIJu+5U UE1PvIJo+nP9fF7zKoesMuriv6aCckChMwGYqWRD/LjeTGg2uDhcn7TEe2kqLNoHNMHY gfM7PqOMF7KWJriDJk5OP0Og+XcIvd959ZQcEqU22gvOBqq/01wrIB2S9VYkD6d6nI0q tUGw== X-Received: by 10.194.76.146 with SMTP id k18mr11878918wjw.115.1427233866896; Tue, 24 Mar 2015 14:51:06 -0700 (PDT) Received: from localhost (213-66-41-37-no99.tbcn.telia.com. [213.66.41.37]) by mx.google.com with ESMTPSA id ew13sm1345666wid.1.2015.03.24.14.51.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 14:51:06 -0700 (PDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On 03/24, Junio C Hamano wrote: > Thomas Gummerer writes: > > > 03f15a7 read-cache: fix reading of split index moved the checks for the > > correct order of index entries out of do_read_index. This loosens the > > checks more than necessary. Re-introduce the checks for the order, but > > don't error out when we have multiple stage-0 entries in the index. > > Return a flag for the caller instead, if we have multiple stage-0 > > entries and let the caller decide if we need to error out. > > > > Signed-off-by: Thomas Gummerer > > --- > > > > This is a patch on top of my previous patch, as that one has already > > been merged to next. > > I am not convinced that this is a good change in the first place. > > The original before your fix was wrong exactly because it was too > tightly tied to the implementation of the index file format where > there was only one file whose contents must be sorted, and that is > why it was a broken check in a new world with split-index. And your > fix in 'next' is the right fix---it makes the verification happen > only on the result is given to the caller for its consumption. > > It may be true that entries may have to be sorted in a certain order > when reading the original index file format and also reading some > steps in reading the split-index, but that merely happens to be an > imprementation detail of the two format currently supported, and as > we improve these formats (or even introduce yet another one) in the > longer term, this patch would re-introduce the same issue your > earlier fix corrected, wouldn't it? Yes, after looking at it again I completely agree. Sorry for the noise.