bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug: tests/fsync.c: don't check for fsync failure on invalid fd


From: Eric Blake
Subject: Re: Bug: tests/fsync.c: don't check for fsync failure on invalid fd
Date: Wed, 13 Mar 2013 10:03:56 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3

On 03/13/2013 09:56 AM, Phillip Susi wrote:
> On 3/13/2013 11:30 AM, Paul Eggert wrote:
>> Gnulib is an application that easily found out that the library
>> violates POSIX, which indicates that the library's main point is
>> not properly supported.  There should be an easy fix, no?
> 
> Gnulib isn't an application; it's a library that provides portability
> workarounds for applications.  It is attesting to the applications
> built with it that they can rely on fsync returning EBADF when given a
> bad file descriptor.  The question I keep asking and not getting an
> answer to is why it bothers doing this?  Is there an application that
> actually depends on this being true, or is it a totally useless test?

Libvirt depends on fsync(), as provided by gnulib, returning EBADF on
invalid fds.  It logs fsync() failures, and such logs have proven
invaluable in detecting double-close bugs, in order to eradicate those
bugs from libvirt.  Crippling gnulib's fsync() to ignore failure on
invalid fds would be one less point of error detection, and we have
already proven, at least in libvirt, that maximal checking during
development is useful for increasing the chances of avoiding a
double-close bug from going undetected into a formal release.

>  If it is a useless test, then the test should be removed rather than
> burden every other task with making a syscall they don't need.

I don't see it as a useless test, which is why I don't think gnulib
should work around libeatmydata's lack of sanity checking.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]