xfs
[Top] [All Lists]

Re: [PATCH 3/9] xfs: correctly decrement the extent buffer index in xfs_

To: Lachlan McIlroy <lmcilroy@xxxxxxxxxx>
Subject: Re: [PATCH 3/9] xfs: correctly decrement the extent buffer index in xfs_bmap_del_extent
From: Lachlan McIlroy <lmcilroy@xxxxxxxxxx>
Date: Thu, 12 May 2011 02:54:41 -0400 (EDT)
Cc: xfs@xxxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>
In-reply-to: <2082652758.471187.1305183010394.JavaMail.root@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: Lachlan McIlroy <lmcilroy@xxxxxxxxxx>
----- Original Message -----
> ----- Original Message -----
> > The code in xfs_bmap_del_extent does not correctly decrement the
> > extent buffer
> > index when deleting a whole extent. Most of the time this gets
> > caught
> > by
> > checks in xfs_bmapi that work around it and decrement it manually
> > and
> > thus
> > wasn't noticed so far.
> >
> > Based on an earlier patch from Lachlan McIlroy.
> >
> > Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> >
> > Index: xfs/fs/xfs/xfs_bmap.c
> > ===================================================================
> > --- xfs.orig/fs/xfs/xfs_bmap.c 2011-05-10 17:11:21.212901236 +0200
> > +++ xfs/fs/xfs/xfs_bmap.c 2011-05-10 17:13:36.177399627 +0200
> > @@ -2916,8 +2916,10 @@ xfs_bmap_del_extent(
> > */
> > xfs_iext_remove(ip, *idx, 1,
> > whichfork == XFS_ATTR_FORK ? BMAP_ATTRFORK : 0);
> > + --*idx;
> 
> I can see why this is needed but if we remove extent at
> idx 0 then wont this go negative and confuse the next
> call to xfs_iext_get_ext()?

Ignore this comment - I see you've fixed that case in patch 6.  Guess I should 
have looked ahead.

> 
> > if (delay)
> > break;
> > +
> > XFS_IFORK_NEXT_SET(ip, whichfork,
> > XFS_IFORK_NEXTENTS(ip, whichfork) - 1);
> > flags |= XFS_ILOG_CORE;
> >
> > _______________________________________________
> > xfs mailing list
> > xfs@xxxxxxxxxxx
> > http://oss.sgi.com/mailman/listinfo/xfs
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>