From marcolz@serv5.ilse.net  Fri May 23 07:06:46 2003
Return-Path: <marcolz@serv5.ilse.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5B30237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 May 2003 07:06:46 -0700 (PDT)
Received: from serv1.ilse.net (serv1.ilse.nl [62.69.160.11])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CB47143FAF
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 May 2003 07:06:44 -0700 (PDT)
	(envelope-from marcolz@serv5.ilse.net)
Received: from serv5.ilse.net (serv5.ilse.net [10.1.8.15])
	by serv1.ilse.net (8.12.8/8.10.2) with ESMTP id h4NE6hxP099611
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 May 2003 16:06:43 +0200 (MEST)
Received: (from marcolz@localhost)
	by serv5.ilse.net (8.12.8/8.12.4/Submit) id h4NE6gAJ038179;
	Fri, 23 May 2003 16:06:42 +0200 (CEST)
Message-Id: <200305231406.h4NE6gAJ038179@serv5.ilse.net>
Date: Fri, 23 May 2003 16:06:42 +0200 (CEST)
From: Marc Olzheim <marcolz@ilse.nl>
Reply-To: Marc Olzheim <marcolz@ilse.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] close() can return undocumented ENOSPC
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52612
>Category:       docs
>Synopsis:       [PATCH] close() can return undocumented ENOSPC
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    trhodes
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 23 07:10:02 PDT 2003
>Closed-Date:    Sat Aug 09 22:31:25 PDT 2003
>Last-Modified:  Sat Aug 09 22:31:25 PDT 2003
>Originator:     Marc Olzheim
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
ilse technology
>Environment:
FreeBSD office-install1.ilse.net 5.0-CURRENT FreeBSD 5.0-CURRENT #8: Tue Apr 29 11:21:52 CEST 2003     root@office-install1.ilse.net:/usr/obj/usr/src/sys/SMP  i386

>Description:
	On cached for example NFS, close can return ENOSPC, indicating
	that it could not correctly write pending flushes to disk. It
	would be nice to have this documented. Also, the paragraph about
	why you should use close() yourself, made me wonder what kind of
	programming we were trying to promote here...
>How-To-Repeat:
	NFS mount a dir, write enough to it (at least 4 Mb in my case,
	it's porbably some buffersize issue), then close() the file and
	see ENOSPC returned.
>Fix:
	Patch follows:


--- /usr/src/lib/libc/sys/close.2	Fri May 23 15:37:05 2003
+++ /usr/src/lib/libc/sys/close.2	Fri May 23 15:48:00 2003
@@ -71,11 +71,9 @@
 file descriptor for that file is closed by that process.
 .Pp
 When a process exits,
-all associated file descriptors are freed, but since there is
-a limit on active descriptors per processes, the
+all associated file descriptors are freed, as though the process called
 .Fn close
-system call
-is useful when a large quantity of file descriptors are being handled.
+itself.
 .Pp
 When a process forks (see
 .Xr fork 2 ) ,
@@ -115,6 +113,8 @@
 is not an active descriptor.
 .It Bq Er EINTR
 An interrupt was received.
+.It Bq Er ENOSPC
+The underlying object did not fit, cached data was lost.
 .El
 .Sh SEE ALSO
 .Xr accept 2 ,
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->trhodes 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Mon Jun 9 10:16:52 PDT 2003 
Responsible-Changed-Why:  
Take this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52612 
State-Changed-From-To: open->patched 
State-Changed-By: trhodes 
State-Changed-When: Fri Jun 13 15:41:35 PDT 2003 
State-Changed-Why:  
Partial commit.  I'm not sure about the first hunk, though, and would 
like some review before I commit it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52612 
State-Changed-From-To: patched->closed 
State-Changed-By: trhodes 
State-Changed-When: Sat Aug 9 22:31:04 PDT 2003 
State-Changed-Why:  
MFC complete, thanks for the submission. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52612 
>Unformatted:
