svn commit: r350806 - stable/11/sbin/camcontrol
Alexander Motin
mav at FreeBSD.org
Thu Aug 8 22:19:44 UTC 2019
Author: mav
Date: Thu Aug 8 22:19:43 2019
New Revision: 350806
URL: https://svnweb.freebsd.org/changeset/base/350806
Log:
MFC r350257: Make `camcontrol hpa` and `camcontrol ama` trigger reprobe.
This makes OS automatically see the disk's new disk size.
Modified:
stable/11/sbin/camcontrol/camcontrol.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sbin/camcontrol/camcontrol.c
==============================================================================
--- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:17:41 2019 (r350805)
+++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:19:43 2019 (r350806)
@@ -301,6 +301,7 @@ static int scsiserial(struct cam_device *device, int t
#endif /* MINIMALISTIC */
static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target,
lun_id_t *lun, cam_argmask *arglst);
+static int reprobe(struct cam_device *device);
static int dorescan_or_reset(int argc, char **argv, int rescan);
static int rescan_or_reset_bus(path_id_t bus, int rescan);
static int scanlun_or_reset_dev(path_id_t bus, target_id_t target,
@@ -370,7 +371,6 @@ static int scsiprintopcodes(struct cam_device *device,
static int scsiopcodes(struct cam_device *device, int argc, char **argv,
char *combinedopt, int task_attr, int retry_count,
int timeout, int verbose);
-static int scsireprobe(struct cam_device *device);
#endif /* MINIMALISTIC */
#ifndef min
@@ -2934,6 +2934,8 @@ atahpa(struct cam_device *device, int retry_count, int
timeout, ccb,
&ident_buf);
atahpa_print(ident_buf, hpasize, 1);
+ /* Hint CAM to reprobe the device. */
+ reprobe(device);
}
}
break;
@@ -3076,6 +3078,8 @@ ataama(struct cam_device *device, int retry_count, int
error = ata_do_identify(device, retry_count,
timeout, ccb, &ident_buf);
ataama_print(ident_buf, nativesize, 1);
+ /* Hint CAM to reprobe the device. */
+ reprobe(device);
}
}
break;
@@ -9313,7 +9317,7 @@ bailout:
#endif /* MINIMALISTIC */
static int
-scsireprobe(struct cam_device *device)
+reprobe(struct cam_device *device)
{
union ccb *ccb;
int retval = 0;
@@ -9325,7 +9329,7 @@ scsireprobe(struct cam_device *device)
return (1);
}
- CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio);
+ CCB_CLEAR_ALL_EXCEPT_HDR(ccb);
ccb->ccb_h.func_code = XPT_REPROBE_LUN;
@@ -10090,7 +10094,7 @@ main(int argc, char **argv)
arglist & CAM_ARG_VERBOSE);
break;
case CAM_CMD_REPROBE:
- error = scsireprobe(cam_dev);
+ error = reprobe(cam_dev);
break;
case CAM_CMD_ZONE:
error = zone(cam_dev, argc, argv, combinedopt,
More information about the svn-src-stable-11
mailing list