From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.95.11.211 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796043731; b=Bmo4V0EwUD/ccSKI/HKVpSJ6wU7aSf4oxv2Bbqta1KHV56YYSmpoxZLazQI4IP0BQCFc WI0IEn5BbUN5HS5TYKZmHQGJNR/ifrdhnmmZTEr4vaNqMV6cwbrdodI2heJcuT3LdINAR WK2fq2MFy7SOBYxUyZxvDl8kXw9Id3DGdflxAQ6jELNm+i7exK/TQFVKUQ7YM7eToLk8d 4wwDTs2ENDyp1MKx1f7fp1qR5527ALnfWzM+9No/LEuTI2eiC1DXH5vyGLHu3B8apnRgo e1ogL+0UZoQG8Hxh8kLETd2LrMwM3u9xj9+mBqdvOPm0Hk330rFRq+PndDUWZbKqPTQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796043731; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; bh=q6KivwEj9MsqZeZk/6OOSVMFdHj4gVI9VILQv8/XjfA=; b=dZ1Fm5FCFKHpocks3t2QuP8vN85G04eNiQ+w/wF7McLSkpcjT+anVdS3zChCzzQ/2Prj tcplYBC/E/mQNRjGxrtJtiX800bvL0LtwwWq6N9qs582PnjjQJn2mj21D7qPT3RDM7TxS vRSAjdFo/WtYCygSfvsefHNu31vCVyvN76XX16flKjgVcBJ9I812an55oeTjPcJFS1llr 4Mgdk3S1LZolGcQgvq4hdhgubC0lNWTi1MjkyYGmmVk0mEkJ222j2dy1kGclF6QRT/C4M trC6/9m2OBwuzM8yEVH5QokWGnOIeyCKM7FjeLGQWy0sSfROQNuzbV60Pbm8SnjHwZA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.remote-ip=213.95.11.211 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC1EB606A31C; Mon, 30 Nov 2026 13:02:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EC1EB606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id D92FE68AFE; Mon, 30 Nov 2026 14:02:06 +0100 (CET) Date: Mon, 30 Nov 2026 14:02:06 +0100 From: Christoph Hellwig To: daejun7.park@samsung.com Cc: Carlos Maiolino , linux-xfs@vger.kernel.org, "Darrick J. Wong" , Dave Chinner , Christoph Hellwig , Chuck Lever , Jeff Layton , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] xfs: punch delalloc blocks past EOF before mapping a pNFS layout Message-ID: <20261130130206.GA28398@lst.de> References: <20261126-xfs-pnfs-delalloc-eof-v1-1-509deb79a255@samsung.com> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261126-xfs-pnfs-delalloc-eof-v1-1-509deb79a255@samsung.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Nov 26, 2026 at 10:45:47AM +0900, Daejun Park via B4 Relay wrote: > @@ -192,6 +193,18 @@ xfs_fs_map_blocks( > if (WARN_ON_ONCE(error)) > goto out_unlock; > > + /* > + * Writeback stops allocating a delalloc extent once the page it writes > + * is covered, so speculative preallocation past EOF can stay delalloc. > + * Delalloc past EOF never holds data. Punch all of it, as > + * xfs_free_eofblocks() does for preallocated files, so that a layout > + * never maps it and a LAYOUTCOMMIT never moves EOF over it. > + */ > + if (ip->i_delayed_blks) > + xfs_bmap_punch_delalloc_range(ip, XFS_DATA_FORK, > + round_up(XFS_ISIZE(ip), mp->m_sb.sb_blocksize), > + LLONG_MAX, NULL); > + This is basically a xfs_free_eofblocks. I think we also should do a xfs_inode_clear_eofblocks_tag here, and we also need to do a inode_dio_wait to settle i_size after taking the iolock.