From owner-dev-commits-src-main@freebsd.org Sat Apr 17 14:49:52 2021 Return-Path: Delivered-To: dev-commits-src-main@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 C6E555D8E6C; Sat, 17 Apr 2021 14:49:52 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FMwwJ5Knmz4lg8; Sat, 17 Apr 2021 14:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9EED1A39A; Sat, 17 Apr 2021 14:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13HEnqgA097310; Sat, 17 Apr 2021 14:49:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13HEnqEW097309; Sat, 17 Apr 2021 14:49:52 GMT (envelope-from git) Date: Sat, 17 Apr 2021 14:49:52 GMT Message-Id: <202104171449.13HEnqEW097309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 0f29396e493b - main - mpt(4): Remove incorrect S/G segments limits. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f29396e493bd87ffa6a63fcb602b12e79d21a1e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2021 14:49:52 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=0f29396e493bd87ffa6a63fcb602b12e79d21a1e commit 0f29396e493bd87ffa6a63fcb602b12e79d21a1e Author: Alexander Motin AuthorDate: 2021-04-17 14:41:35 +0000 Commit: Alexander Motin CommitDate: 2021-04-17 14:49:44 +0000 mpt(4): Remove incorrect S/G segments limits. First, two of those four checks are unreachable. Second, I don't believe there should be ">=" instead of ">". Third, bus_dma(9) already returns the same EFBIG if ">". This fixes false I/O errors in worst S/G cases with maxphys >= 2MB. MFC after: 1 week --- sys/dev/mpt/mpt_cam.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index 90c84eee2442..64776d673674 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -1292,10 +1292,6 @@ mpt_execute_req_a64(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) hdrp = req->req_vbuf; mpt_off = req->req_vbuf; - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - } - if (error == 0) { switch (hdrp->Function) { case MPI_FUNCTION_SCSI_IO_REQUEST: @@ -1315,12 +1311,6 @@ mpt_execute_req_a64(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) } } - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - mpt_prt(mpt, "segment count %d too large (max %u)\n", - nseg, mpt->max_seg_cnt); - } - bad: if (error != 0) { if (error != EFBIG && error != ENOMEM) { @@ -1694,10 +1684,6 @@ mpt_execute_req(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) hdrp = req->req_vbuf; mpt_off = req->req_vbuf; - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - } - if (error == 0) { switch (hdrp->Function) { case MPI_FUNCTION_SCSI_IO_REQUEST: @@ -1716,12 +1702,6 @@ mpt_execute_req(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) } } - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - mpt_prt(mpt, "segment count %d too large (max %u)\n", - nseg, mpt->max_seg_cnt); - } - bad: if (error != 0) { if (error != EFBIG && error != ENOMEM) {