Re: [PATCH 37/63] xfs: cancel CoW reservations and clear inode reflink flag when freeing blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 29, 2016 at 10:01:09AM -0700, Christoph Hellwig wrote:
> On Tue, Sep 27, 2016 at 07:57:35PM -0700, Darrick J. Wong wrote:
> > +	/* Remove all pending CoW reservations. */
> > +	error = xfs_reflink_cancel_cow_blocks(ip, &tp, first_unmap_block,
> > +			last_block);
> > +	if (error)
> > +		goto out;
> > +
> > +	/*
> > +	 * Clear the reflink flag if we truncated everything.
> > +	 */
> > +	if (ip->i_d.di_nblocks == 0 && xfs_is_reflink_inode(ip))
> > +		ip->i_d.di_flags2 &= ~XFS_DIFLAG2_REFLINK;
> 
> Shouldn't this (and the later added clearing of the cowblocks tag)
> be moved into xfs_reflink_cancel_cow_blocks?

Truncate is the only caller of _reflink_cancel_cow_blocks where we
actually free blocks from the data fork.  The other callers (IO error,
CoW fork GC, inode reclaim) don't remove extents from the data fork. 
Therefore, I think it's fine to leave this where it is.

(I guess we could move it there on the off chance we do somehow end
up with zero blocks, but this seems unlikely.)

--D
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux