Skip to content

Commit

Permalink
DLPX-86794 sdb: zio broken after upstream ZFS commit
Browse files Browse the repository at this point in the history
Our `zio` command broke from the commit introduced by the following
upstream PR: openzfs/zfs#14948

The problem is that the PR removed `io_parent_count` from `struct zio`
and we are using this field to find the top-level ZIOs (e.g. ZIOs with
no parents) in the system.

This patch changes our SBD command to check whether the `io_parent_list`
is populated instead.
  • Loading branch information
sdimitro committed Jul 5, 2023
1 parent 0cb4f96 commit e13a82e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sdb/commands/zfs/zio.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ def from_zio(self, zio: drgn.Object) -> Iterable[drgn.Object]:
yield from self.from_zio(c.zl_parent)
self.level -= 1

@staticmethod
def zio_has_parents(zio: drgn.Object) -> bool:
parent_list = zio.io_parent_list.list_head.address_of_()
first_parent = parent_list.next
if parent_list != first_parent:
return True
return False

def no_input(self) -> drgn.Object:
if self.args.parents:
raise sdb.CommandInvalidInputError(
Expand All @@ -136,5 +144,5 @@ def no_input(self) -> drgn.Object:
[sdb.Walk(), sdb.Cast(["zio_t *"])],
)
for zio in zios:
if zio.io_parent_count == 0:
if not self.zio_has_parents(zio):
yield from self.from_zio(zio)

0 comments on commit e13a82e

Please sign in to comment.