Linux kernel LOCK_MAND deprecation

Jeff Layton jlayton at samba.org
Mon Sep 13 14:02:01 UTC 2021


I recently proposed a patch to remove most of the support for
flock(..., LOCK_MAND...) from the Linux kernel. The code in question has
been broken for well over a decade, such that trying to use LOCK_MAND
flock locks is really just a no-op:

    https://lore.kernel.org/linux-fsdevel/20210910201915.95170-1-jlayton@kernel.org/

Samba references that symbol in kernel_flock(). I started to take a look
at removing the code from samba, but the work kind of snowballed with
all of the wrappers and indirection.

Would anyone who is actively working on samba want to take a stab at
removing kernel_flock()? It should be safe to just rip it out since it
hasn't worked in ages.

If it's not removed, then you may see kernel warnings on Linux when
samba tries to set a LOCK_MAND lock, a'la:

   pr_warn_once("Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n");

Thanks,
-- 
Jeff Layton <jlayton at samba.org>




More information about the samba-technical mailing list