| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 7/9] xfs: do not do pointer arithmetics on extent records |
| From: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
| Date: | Wed, 11 May 2011 11:04:09 -0400 |
| References: | <20110511150402.258164661@xxxxxxxxxxxxxxxxxxxxxx> |
| User-agent: | quilt/0.48-1 |
We need to call xfs_iext_get_ext for the previous extent to get a valid
pointer, and can't just do pointer arithmetics as they might be in
different pages.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Index: xfs/fs/xfs/xfs_bmap.c
===================================================================
--- xfs.orig/fs/xfs/xfs_bmap.c 2011-05-11 10:16:58.847733078 +0200
+++ xfs/fs/xfs/xfs_bmap.c 2011-05-11 10:17:04.803235692 +0200
@@ -5145,9 +5145,12 @@ xfs_bunmapi(
*/
ASSERT(bno >= del.br_blockcount);
bno -= del.br_blockcount;
- if (bno < got.br_startoff) {
- if (--lastx >= 0)
- xfs_bmbt_get_all(--ep, &got);
+ if (got.br_startoff > bno) {
+ if (--lastx >= 0) {
+ ep = xfs_iext_get_ext(ifp,
+ lastx);
+ xfs_bmbt_get_all(ep, &got);
+ }
}
continue;
} else if (del.br_state == XFS_EXT_UNWRITTEN) {
|
| Previous by Date: | [PATCH 5/9] xfs: do not use unchecked extent indices in xfs_bmapi, Christoph Hellwig |
|---|---|
| Next by Date: | [PATCH 3/9] xfs: correctly decrement the extent buffer index in xfs_bmap_del_extent, Christoph Hellwig |
| Previous by Thread: | Re: [PATCH 5/9] xfs: do not use unchecked extent indices in xfs_bmapi, Alex Elder |
| Next by Thread: | Re: [PATCH 7/9] xfs: do not do pointer arithmetics on extent records, Lachlan McIlroy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |