Date: Mon, 3 Dec 2012 04:29:18 GMT From: Garrett Cooper <yanegomi@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/174072: [patch] mptutil: capture cam related errors Message-ID: <201212030429.qB34TIF1060513@red.freebsd.org> Resent-Message-ID: <201212030430.qB34U0xY000848@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 174072 >Category: bin >Synopsis: [patch] mptutil: capture cam related errors >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 03 04:30:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: n/a >Organization: EMC Isilon >Environment: n/a >Description: The attached patch catches cam-related errors when using mptutil. >How-To-Repeat: >Fix: Patch attached with submission follows: Index: usr.sbin/mptutil/mpt_config.c =================================================================== --- usr.sbin/mptutil/mpt_config.c (revision 243802) +++ usr.sbin/mptutil/mpt_config.c (working copy) @@ -305,10 +305,10 @@ } 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); @@ -742,7 +742,7 @@ #ifdef DEBUG skip: #endif - mpt_rescan_bus(vol->VolumeBus, vol->VolumeID); + error = mpt_rescan_bus(vol->VolumeBus, vol->VolumeID); /* Clean up. */ free(vol); @@ -752,7 +752,7 @@ free(state.ioc2); close(fd); - return (0); + return (error); } MPT_COMMAND(top, create, create_volume); @@ -792,10 +792,10 @@ 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); @@ -1015,7 +1015,9 @@ 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); @@ -1119,7 +1121,9 @@ 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); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212030429.qB34TIF1060513>