Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jul 2014 17:45:34 -0700
From:      Adrian Chadd <adrian.chadd@gmail.com>
To:        "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>
Subject:   EDEADLK from fcntl(F_SETFL) ?
Message-ID:  <CAJ-Vmo=szh6rk5s1H5mZXQZwvm2YZjBK5LQkLoOOZyQT6yhMjw@mail.gmail.com>

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

Hi!

I've seen sqlite3 crap out due to "disk IO error". It looks like the
F_SETFL path is returning EDEADLK when it shouldn't be - only the
"wait" version of this should be.

The kernel code looks to be:

lf_setlock() -> lf_add_outgoing() -> lf_add_edge() -> graph_add_edge()
-> EDEADLK

.. and lf_setlock() will return an error from lf_add_outgoing()
without checking if it's (a) EDEADLK, and (b) whether we're going to
sleep or not.

So, sqlite3 trips up on this. I'm sure other things do. What should
the correct thing be? It looks like EWOULDBLOCK is the correct value
to return for F_SETFL failing, not EDEADLK.

What do those-who-know-POSIX-standards-better-than-I think?

Thanks!



-a



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=szh6rk5s1H5mZXQZwvm2YZjBK5LQkLoOOZyQT6yhMjw>