Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Mar 2016 21:59:05 -0700
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        "cem@FreeBSD.org" <cem@FreeBSD.org>
Cc:        Benjamin Kaduk <bjkfbsd@gmail.com>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r297201 - in head: share/man/man4 sys/dev/filemon
Message-ID:  <1FEF661F-FDEC-4711-A381-4EAA4ACDBA1D@FreeBSD.org>
In-Reply-To: <CAG6CVpUMAHN8S_wjz57BGHfJ0OTHdboLt2Wz2gvxD%2BSmwEAqGA@mail.gmail.com>
References:  <201603222241.u2MMf7ub090070@repo.freebsd.org> <CAG6CVpUxC6Nov7ocy5eEpcQFLd%2BQdXUxZWs49kTesWZo_VqncQ@mail.gmail.com> <D2476F6F-8C58-489D-9654-DFF2AEB9941F@FreeBSD.org> <CAJ5_RoD1J_LOvN5hzSF_DsUHd_mtn=XZDYcZU5xOBiyRSVjVDg@mail.gmail.com> <CAG6CVpUMAHN8S_wjz57BGHfJ0OTHdboLt2Wz2gvxD%2BSmwEAqGA@mail.gmail.com>

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



> On Mar 22, 2016, at 20:18, Conrad Meyer <cem@FreeBSD.org> wrote:
>=20
>> On Tue, Mar 22, 2016 at 7:46 PM, Benjamin Kaduk <bjkfbsd@gmail.com> wrote=
:
>>> On Tue, Mar 22, 2016 at 9:11 PM, Bryan Drewery <bdrewery@freebsd.org> wr=
ote:
>>>=20
>>> The manpage for close(2) does document some errors, one being ENOSPC.  T=
he
>>> close(2) behavior of returning write(2), really VOP_WRITE(9), errors tho=
ugh
>>> is specific to filemon since all of the writes are hidden and this is th=
e
>>> only place to return an error.
>>> ...
>>=20
>> filemon is not unique in this regard; the AFS filesystem buffers writes
>> locally and in some cases errors writing to the remote server can be dela=
yed
>> until close().
>=20
> Right.  filemon is not the only case.  Another example would be TCP
> socket fds, e.g., when the connection is RST after write(2) queues
> data on the outgoing sockbuf but before it is transmitted.
>=20

I'm really not saying it's the only case. I'm saying close(2) returning a do=
zen write(2) errors is not normal and is documented here because it is expec=
ted here.  Anyone could write a module or FS that returns some random error o=
n close(2). That doesn't mean it should be documented directly in close(2). =
 Consider the next commit here also returns EFAULT and ENAMELEN, which defin=
itely are special case.  There are only 2 filemon consumers, script(1) and b=
make. For bmake there is a patch in testing to utilize the close(2) error, s=
ince it's currently ignored. For script(1) I need to fix it still.

If there are errors that are common and missing from close(2), please do doc=
ument them.  As Benjamin referenced, most people never fathom that it can ev=
en fail.  I know that NFS errors are not widely documented too.

Bryan=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1FEF661F-FDEC-4711-A381-4EAA4ACDBA1D>