Re: [RFC][PATCH] fstests: regression test for xfs leftover CoW extent error

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

 



On Mon, Sep 04, 2017 at 05:30:26PM +0200, Christoph Hellwig wrote:
> On Sun, Sep 03, 2017 at 02:04:27PM -0700, Darrick J. Wong wrote:
> > On Sun, Sep 03, 2017 at 08:21:33PM +0200, Christoph Hellwig wrote:
> > > > So basically there are two bugs here -- the fcollapse/finsert code needs
> > > > to shift the CoW fork extents down and up;
> > > 
> > > Or make sure that we don't have any extents in the COW fork?
> > 
> > It's a big hammer approach, but yes that'd work.
> > 
> > We're already forcing all the dirty pages out anyway so I guess it's no
> > big deal.
> 
> It might be a big deal for my O_ATOMIC work, but I'll need to need
> to find that work and actually define semantics vs nasty operations
> like insert and swapext for that.
> 
> Then again shifting the cow forks seems relatively easy - we'd just
> need to look at the whichfork argument in the low-level helpers
> basically.

Yes, it looks pretty straightforward.  I'll send my dumb version that
merely evicts everything from the cow fork to the list and see if that
motivates anyone to try their hand at shifting the cow fork.

> > > >         /*
> > > >          * Clear the reflink flag if we truncated everything.
> > > >          */
> > > > -       if (ip->i_d.di_nblocks == 0 && xfs_is_reflink_inode(ip)) {
> > > > +       if (ip->i_d.di_nblocks == 0 && ip->i_cnextents == 0 && xfs_is_reflink_inode(ip)) {
> > > 
> > > Btw, it seems like we should generally clear the reflink flag and
> > > tag if ip->i_cnextents is zero and not even bother looking at di_nblocks.
> > 
> > We can't -- imagine shortening to 8k a reflinked 12k file that hasn't been
> > written to.  It has no cow extents, but we cannot drop the reflink flag.
> 
> True for the reflink flag.  But we should be able to clear the cowblocks
> tag whenever i_cnextents reaches zero.

<nod> I was about to send out a cleaner patch.

--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
--
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