Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp290587ybh; Thu, 12 Mar 2020 02:02:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtpQ/PfMnDE+//ch1Fmgc1ydbJrOzFSSNM3oVn/wLTTvLs4fwEmgzvdYM92XMxpcREj8JVS X-Received: by 2002:a4a:bf19:: with SMTP id r25mr3149771oop.3.1584003754065; Thu, 12 Mar 2020 02:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584003754; cv=none; d=google.com; s=arc-20160816; b=GAdxWtuW27DS1omJDg0b3AQEwij0iPgyRnqJ+ubInuwe5YCP/RPtkimmA33jqKFqO4 gJE0KHWzSWJSrxxDKvs6G3l0lSj+6UfziVdldwS9mjsWI2H9JgwAGeh5u6FdaDUQH5rm dQxFLyeV+sKN1vI1MMmLZ3E2Ctzj8l++E3Fh9/YBbK53s/BYWUy3jHDJwpRC43kNBGq2 z1n3XtxUVUb2a0iHGvb1qVCT6M2+SeB2mS7o9mmqLd8DOi7Tasy1PDKOY1f4pHvpUemk iV0zzqvqSoYVqs//8rEV9sQwA+NGg/IkCegQO0zqTJpFtG43Tj8PHG69j8/xOzf0nQ+t uvkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MuLyPczXbATnEEOI9hYb1Jtl0bRY2PIJDZVmgSRVYYQ=; b=lTbUAdmEBVar7PPUnxMl3Nb+k7xRmA6vOUUJLGSLfOg9ubbwpUY+yC9QyC2YqM/B08 GAysqNNw/SWE4OFTP+Lrm2kiHwiVRFS7UpjC49lBRWCrWGoNLAHXsyh/2AW6s209cPYz 7f5h9RmN16VEoNDfLfk5uyNgERIGfQC8QSKV/VHc7TrBf492vI9fqK3bdnl9dwzF6vNa 3Z6goHo31lrbubxLxzxs7oMGxd0IdPvmevuXIWZNOxMVYa9TA+aHJGLrZHr7bhK9aP+O k7SB82kqNpYwIsyhUqEW/I+HPF+zCyMbx3wi8B0fP0m2FqpYyF1rLS9LDIJ//Y3h2wUG 3mig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si2236013oie.63.2020.03.12.02.02.20; Thu, 12 Mar 2020 02:02:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbgCLJBb (ORCPT + 99 others); Thu, 12 Mar 2020 05:01:31 -0400 Received: from verein.lst.de ([213.95.11.211]:35571 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725980AbgCLJBb (ORCPT ); Thu, 12 Mar 2020 05:01:31 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 9884F68C4E; Thu, 12 Mar 2020 10:01:28 +0100 (CET) Date: Thu, 12 Mar 2020 10:01:28 +0100 From: Christoph Hellwig To: Tommi Rantala Cc: Christoph Hellwig , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] xfs: fix regression in "cleanup xfs_dir2_block_getdents" Message-ID: <20200312090128.GA11127@lst.de> References: <20200312085728.22187-1-tommi.t.rantala@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200312085728.22187-1-tommi.t.rantala@nokia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2020 at 10:57:28AM +0200, Tommi Rantala wrote: > Commit 263dde869bd09 ("xfs: cleanup xfs_dir2_block_getdents") introduced > a getdents regression, when it converted the pointer arithmetics to > offset calculations: offset is updated in the loop already for the next > iteration, but the updated offset value is used incorrectly in two > places, where we should have used the not-yet-updated value. > > This caused for example "git clean -ffdx" failures to cleanup certain > directory structures when running in a container. > > Fix the regression by making sure we use proper offset in the loop body. > Thanks to Christoph Hellwig for suggestion how to best fix the code. > > Cc: Christoph Hellwig > Fixes: 263dde869bd09 ("xfs: cleanup xfs_dir2_block_getdents") > Signed-off-by: Tommi Rantala Looks good, Reviewed-by: Christoph Hellwig