Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Oct 2018 06:10:45 -0700
From:      Gleb Smirnoff <glebius@freebsd.org>
To:        "Enji Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, freebsd-net <freebsd-net@freebsd.org>, Jonathan Looney <jonlooney@gmail.com>
Subject:   Re: Relatively deterministic panic with sendfile(2) when running tests in the sxlock code
Message-ID:  <20181015131045.GX1044@FreeBSD.org>
In-Reply-To: <D5F7ABC3-89F1-48B9-94B0-067E3DE3F5B2@gmail.com>
References:  <CC816726-7B79-4643-82DD-7B4CF4A25F54@gmail.com> <20181015022518.GV1044@FreeBSD.org> <1B58488D-8615-40E8-9115-E26496A6DBCE@gmail.com> <BA546783-C2DA-4ED9-8391-8408A8B9145B@gmail.com> <D5F7ABC3-89F1-48B9-94B0-067E3DE3F5B2@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181015131045.GX1044>