[PATCH] resctrl: Do not open directory for writing
Andrea Bolognani
abologna at redhat.com
Fri Jul 10 13:39:42 UTC 2020
On Fri, 2020-07-10 at 15:13 +0200, Martin Kletzander wrote:
> On Fri, Jul 10, 2020 at 10:47:22AM +0200, Michal Privoznik wrote:
> > On 7/9/20 6:30 PM, Andrea Bolognani wrote:
> > > This is all bikeshedding, of course: what actually matters is making
> > > that lock exclusive once again :)
> >
> > Just realized that for exclusive (aka write) lock, the FD must be opened
> > for writing (working on patches for the following report [1] and been
> > experimenting a bit and that's what I'm seeing).
>
> Good point, but luckily not related to flock(2).
That seems to be the case: according to flock(2),
A shared or exclusive lock can be placed on a file regardless
of the mode in which the file was opened.
Michal, does that sound reasonable to you?
--
Andrea Bolognani / Red Hat / Virtualization
More information about the libvir-list
mailing list