public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Review: xfs_bmapi does not update previous extent pointer correctly
@ 2007-06-04  5:19 David Chinner
  2007-06-04  5:26 ` Vlad Apostolov
  0 siblings, 1 reply; 2+ messages in thread
From: David Chinner @ 2007-06-04  5:19 UTC (permalink / raw)
  To: xfs-dev; +Cc: xfs-oss

When looping across multiple extents, xfs_bmapi will fail to
update the previous extent pointer which is used in subsequent
loops.

As a result, we can end up with the second loop in xfs_bmapi trying
to use an incorrect previous extent pointer and assert failures or
corrupted in-memory extent lists will result.

Correctly update the previous extent at the end of each loop so that
we DTRT when processing multiple map requests.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

---
 fs/xfs/xfs_bmap.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: 2.6.x-xfs-new/fs/xfs/xfs_bmap.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_bmap.c	2007-05-23 16:33:00.000000000 +1000
+++ 2.6.x-xfs-new/fs/xfs/xfs_bmap.c	2007-05-25 11:53:31.949847746 +1000
@@ -5575,10 +5575,10 @@ xfs_bmapi(
 		 * Else go on to the next record.
 		 */
 		ep = xfs_iext_get_ext(ifp, ++lastx);
-		if (lastx >= nextents) {
+		prev = got;
+		if (lastx >= nextents)
 			eof = 1;
-			prev = got;
-		} else
+		else
 			xfs_bmbt_get_all(ep, &got);
 	}
 	ifp->if_lastex = lastx;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Review: xfs_bmapi does not update previous extent pointer correctly
  2007-06-04  5:19 Review: xfs_bmapi does not update previous extent pointer correctly David Chinner
@ 2007-06-04  5:26 ` Vlad Apostolov
  0 siblings, 0 replies; 2+ messages in thread
From: Vlad Apostolov @ 2007-06-04  5:26 UTC (permalink / raw)
  To: David Chinner; +Cc: xfs-dev, xfs-oss

It is looking good Dave,

Regards,
Vlad

David Chinner wrote:
> When looping across multiple extents, xfs_bmapi will fail to
> update the previous extent pointer which is used in subsequent
> loops.
>
> As a result, we can end up with the second loop in xfs_bmapi trying
> to use an incorrect previous extent pointer and assert failures or
> corrupted in-memory extent lists will result.
>
> Correctly update the previous extent at the end of each loop so that
> we DTRT when processing multiple map requests.
>
> Cheers,
>
> Dave.
>   

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-04  5:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-04  5:19 Review: xfs_bmapi does not update previous extent pointer correctly David Chinner
2007-06-04  5:26 ` Vlad Apostolov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox