Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1c63b73 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder
Browse files

xfs: do not do pointer arithmetic on extent records



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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarLachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent 00239acf
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -5143,9 +5143,12 @@ xfs_bunmapi(
				 */
				 */
				ASSERT(bno >= del.br_blockcount);
				ASSERT(bno >= del.br_blockcount);
				bno -= del.br_blockcount;
				bno -= del.br_blockcount;
				if (bno < got.br_startoff) {
				if (got.br_startoff > bno) {
					if (--lastx >= 0)
					if (--lastx >= 0) {
						xfs_bmbt_get_all(--ep, &got);
						ep = xfs_iext_get_ext(ifp,
								      lastx);
						xfs_bmbt_get_all(ep, &got);
					}
				}
				}
				continue;
				continue;
			} else if (del.br_state == XFS_EXT_UNWRITTEN) {
			} else if (del.br_state == XFS_EXT_UNWRITTEN) {