Re: [PATCH v5 13/14] locks: skip deadlock detection on FL_FILE_PVTlocks

From: J. Bruce Fields
Date: Tue Jan 14 2014 - 16:31:09 EST


On Tue, Jan 14, 2014 at 04:21:53PM -0500, Richard Hipp wrote:
> SQLite uses only F_SETLK, never F_SETLKW. Doesn't that mean that SQLite
> will work the same with or without deadlock detection? Doesn't deadlock
> detection only come into play with F_SETLKW?

That's correct.

> > >> (Actually, what happens if you receive a signal which waiting on a file
> > lock?)
> > >
> > > Return -EINTR.
> >
>
> Huh. SQLite is not checking for EINTR if fcntl(F_SETLK,...) fails. Should
> it be? Or does EINTR only come up for F_SETLKW?

I don't know--I wonder if a distributed filesystem, for example, might
allow even a non-blocking lock request to be interrupted? Might be
interesting to check what nfs does.

--b.

>
> We do check for EINTR and retry for other system calls (read(), write(),
> fallocate(), ftruncate(), close(), chmod(), open(), maybe others too).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/