From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 565C7C433FE for ; Tue, 3 May 2022 23:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238125AbiECXGy (ORCPT ); Tue, 3 May 2022 19:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233290AbiECXGx (ORCPT ); Tue, 3 May 2022 19:06:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1C4E18B26; Tue, 3 May 2022 16:03:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6D0A46101F; Tue, 3 May 2022 23:03:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2310C385AE; Tue, 3 May 2022 23:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651618998; bh=jlwf+IIg3B40wdjg00yJJUQCkXo+SaUIfI9GCxnrxwI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DPwVJU+rpoAnsBo8X3wbualMXXklXalbLiLit2/mLC7GcvN13uJrqPHalMFiJspzb G7ahRkNuLTeMRERwpkkaWGkIBvRohQhQxuUZTQ2a4hLkMC0bhi0G76bZxqq609NyJE 8S13EL2FHR6lSuqPf15inuEyYxPzFMaOtioGcGCdGEON9tiXr5J2MbCbjGr2lU9/xM bxOXzbg63Z9b/UdLMymYfauATuCJWgpw+c72XGk8ev9qondJkn2isL2BHm2QP26rWm 4DvKYIrMBRiqnrbSWD7exz3SpL/fztR/BDvD3D8c652mAXISdXFeHJdcBorcaB3RBF j4J47mCIV4wkw== Date: Tue, 3 May 2022 16:03:18 -0700 From: "Darrick J. Wong" To: Andreas Gruenbacher Cc: Christoph Hellwig , Linus Torvalds , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] iomap: iomap_write_failed fix Message-ID: <20220503230318.GL8265@magnolia> References: <20220503213645.3273828-1-agruenba@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220503213645.3273828-1-agruenba@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, May 03, 2022 at 11:36:45PM +0200, Andreas Gruenbacher wrote: > The @lend parameter of truncate_pagecache_range() should be the offset > of the last byte of the hole, not the first byte beyond it. > > Fixes: ae259a9c8593 ("fs: introduce iomap infrastructure") > Signed-off-by: Andreas Gruenbacher I'll queue this up for ... 5.19? Testing infrastructure still sorta tied up until I get at least two clean runs on 5.18-rcX, which still hasn't happened yet. Reviewed-by: Darrick J. Wong --D > --- > fs/iomap/buffered-io.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c > index 8ce8720093b9..358ee1fb6f0d 100644 > --- a/fs/iomap/buffered-io.c > +++ b/fs/iomap/buffered-io.c > @@ -531,7 +531,8 @@ iomap_write_failed(struct inode *inode, loff_t pos, unsigned len) > * write started inside the existing inode size. > */ > if (pos + len > i_size) > - truncate_pagecache_range(inode, max(pos, i_size), pos + len); > + truncate_pagecache_range(inode, max(pos, i_size), > + pos + len - 1); > } > > static int iomap_read_folio_sync(loff_t block_start, struct folio *folio, > -- > 2.35.1 >