git: d90e14fc18e8 - main - mptutil: Capture CAM errors from bus rescan
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 05 Feb 2025 05:28:13 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=d90e14fc18e8d276b9b4318b4ca0e16f015c2658
commit d90e14fc18e8d276b9b4318b4ca0e16f015c2658
Author: Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2025-02-05 03:52:38 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-02-05 03:54:26 +0000
mptutil: Capture CAM errors from bus rescan
This will force reporting of CAM errors from rescanning the bus.
PR: 174072
Reviewed by: imp
---
usr.sbin/mptutil/mpt_config.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/usr.sbin/mptutil/mpt_config.c b/usr.sbin/mptutil/mpt_config.c
index 88fb619c7eba..066f8df28268 100644
--- a/usr.sbin/mptutil/mpt_config.c
+++ b/usr.sbin/mptutil/mpt_config.c
@@ -313,10 +313,10 @@ clear_config(int ac, char **av)
}
printf("mpt%d: Configuration cleared\n", mpt_unit);
- mpt_rescan_bus(-1, -1);
+ error = mpt_rescan_bus(-1, -1);
close(fd);
- return (0);
+ return (error);
}
MPT_COMMAND(top, clear, clear_config);
@@ -771,7 +771,7 @@ create_volume(int ac, char **av)
#ifdef DEBUG
skip:
#endif
- mpt_rescan_bus(vol->VolumeBus, vol->VolumeID);
+ error = mpt_rescan_bus(vol->VolumeBus, vol->VolumeID);
/* Clean up. */
free(vol);
@@ -781,7 +781,7 @@ skip:
free(state.ioc2);
close(fd);
- return (0);
+ return (error);
}
MPT_COMMAND(top, create, create_volume);
@@ -825,10 +825,10 @@ delete_volume(int ac, char **av)
return (error);
}
- mpt_rescan_bus(-1, -1);
+ error = mpt_rescan_bus(-1, -1);
close(fd);
- return (0);
+ return (error);
}
MPT_COMMAND(top, delete, delete_volume);
@@ -1071,7 +1071,9 @@ remove_spare(int ac, char **av)
return (error);
}
- mpt_rescan_bus(info->PhysDiskBus, info->PhysDiskID);
+ error = mpt_rescan_bus(info->PhysDiskBus, info->PhysDiskID);
+ if (error)
+ return (error);
free(info);
close(fd);
@@ -1175,7 +1177,9 @@ pd_delete(int ac, char **av)
return (error);
}
- mpt_rescan_bus(info->PhysDiskBus, info->PhysDiskID);
+ error = mpt_rescan_bus(info->PhysDiskBus, info->PhysDiskID);
+ if (error)
+ return (error);
free(info);
close(fd);