From owner-svn-src-all@freebsd.org  Sat Apr  2 06:18:20 2016
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EB3FB00047;
 Sat,  2 Apr 2016 06:18:20 +0000 (UTC)
 (envelope-from dchagin@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 mx1.freebsd.org (Postfix) with ESMTPS id 29E5B128F;
 Sat,  2 Apr 2016 06:18:20 +0000 (UTC)
 (envelope-from dchagin@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u326IJRc065624;
 Sat, 2 Apr 2016 06:18:19 GMT (envelope-from dchagin@FreeBSD.org)
Received: (from dchagin@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id u326IJwm065623;
 Sat, 2 Apr 2016 06:18:19 GMT (envelope-from dchagin@FreeBSD.org)
Message-Id: <201604020618.u326IJwm065623@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dchagin set sender to
 dchagin@FreeBSD.org using -f
From: Dmitry Chagin <dchagin@FreeBSD.org>
Date: Sat, 2 Apr 2016 06:18:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r297503 - stable/10/sys/compat/linux
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Apr 2016 06:18:20 -0000

Author: dchagin
Date: Sat Apr  2 06:18:19 2016
New Revision: 297503
URL: https://svnweb.freebsd.org/changeset/base/297503

Log:
  MFC r297297:
  
  When write(2) on eventfd object fails with the error EAGAIN do not return the number of bytes written.

Modified:
  stable/10/sys/compat/linux/linux_event.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_event.c
==============================================================================
--- stable/10/sys/compat/linux/linux_event.c	Sat Apr  2 06:15:14 2016	(r297502)
+++ stable/10/sys/compat/linux/linux_event.c	Sat Apr  2 06:18:19 2016	(r297503)
@@ -748,6 +748,8 @@ retry:
 	if (UINT64_MAX - efd->efd_count <= count) {
 		if ((efd->efd_flags & LINUX_O_NONBLOCK) != 0) {
 			mtx_unlock(&efd->efd_lock);
+			/* Do not not return the number of bytes written */
+			uio->uio_resid += sizeof(eventfd_t);
 			return (EAGAIN);
 		}
 		error = mtx_sleep(&efd->efd_count, &efd->efd_lock,