From owner-freebsd-current@freebsd.org Mon Oct 15 13:10:47 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 410A310DB376; Mon, 15 Oct 2018 13:10:47 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C240673ED1; Mon, 15 Oct 2018 13:10:46 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w9FDAjCv091990 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Oct 2018 06:10:45 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w9FDAjlN091989; Mon, 15 Oct 2018 06:10:45 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 15 Oct 2018 06:10:45 -0700 From: Gleb Smirnoff To: "Enji Cooper (yaneurabeya)" Cc: FreeBSD Current , freebsd-net , Jonathan Looney Subject: Re: Relatively deterministic panic with sendfile(2) when running tests in the sxlock code Message-ID: <20181015131045.GX1044@FreeBSD.org> References: <20181015022518.GV1044@FreeBSD.org> <1B58488D-8615-40E8-9115-E26496A6DBCE@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2iBwrppp/7QCDedR" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2018 13:10:47 -0000 --2iBwrppp/7QCDedR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Enji, can you please check that with this patch all your tests pass? -- Gleb Smirnoff --2iBwrppp/7QCDedR Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sendfile-listening.diff" Index: sys/kern/kern_sendfile.c =================================================================== --- sys/kern/kern_sendfile.c (revision 339098) +++ sys/kern/kern_sendfile.c (working copy) @@ -526,6 +526,8 @@ sendfile_getsock(struct thread *td, int s, struct *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); + if (SOLISTENING(so)) + return (ENOTCONN); return (0); } --2iBwrppp/7QCDedR--