From owner-svn-src-stable@freebsd.org Thu Aug 8 22:19:44 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94E1CB55B5; Thu, 8 Aug 2019 22:19:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464N8c386vz3GHB; Thu, 8 Aug 2019 22:19:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3069A4092; Thu, 8 Aug 2019 22:19:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78MJiUh048288; Thu, 8 Aug 2019 22:19:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78MJhnV048287; Thu, 8 Aug 2019 22:19:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082219.x78MJhnV048287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350806 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 22:19:44 -0000 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,