From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:39432 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752581AbcJJRUB (ORCPT ); Mon, 10 Oct 2016 13:20:01 -0400 Date: Mon, 10 Oct 2016 10:18:31 -0700 From: "Darrick J. Wong" Subject: Re: [PATCH 7/7] xfs: clear reflink flag if setting realtime flag Message-ID: <20161010171831.GA22379@birch.djwong.org> References: <147588163396.12127.8356851783027062457.stgit@birch.djwong.org> <147588168294.12127.1609759616316145097.stgit@birch.djwong.org> <20161010102418.GG18359@infradead.org> <20161010122507.GA23194@dastard> <20161010124500.GA29158@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161010124500.GA29158@infradead.org> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Christoph Hellwig Cc: Dave Chinner , linux-xfs@vger.kernel.org, Brian Foster On Mon, Oct 10, 2016 at 05:45:00AM -0700, Christoph Hellwig wrote: > On Mon, Oct 10, 2016 at 11:25:08PM +1100, Dave Chinner wrote: > > On Mon, Oct 10, 2016 at 03:24:18AM -0700, Christoph Hellwig wrote: > > > On Fri, Oct 07, 2016 at 04:08:03PM -0700, Darrick J. Wong wrote: > > > > Since we can only turn on the rt flag if there are no data extents, > > > > we can safely turn off the reflink flag if the rt flag is being > > > > turned on. > > > > > > Why would the reflink flag ever be turned on if we have no data extents? > > > > After a truncate? > > Any why don't we simply clear the flag when we know there can't be > any shared extents left? We /do/ clear the flag if we truncate everything out of the file. See the end of xfs_itruncate_extents(). --D