All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ganss <michael.ganss@oo-services.com>
To: linux-fsdevel@vger.kernel.org
Subject: mandatory locks and LOCK_MAND
Date: Wed, 24 Apr 2002 13:11:15 +0200	[thread overview]
Message-ID: <3CC692D3.7040907@oo-services.com> (raw)

Hi,

I'm trying to get mandatory file locking to work. I don't want to use 
the mount option plus permission bits hack.
The only helpful document I could find (besides mandatory.txt in the 
kernel sources) was http://infradead.org/~willy/locking_manifesto.html
which describes "share modes":

"*  Share modes. These are whole-file mandatory locks. No other process 
may open a file which would conflict with the Share Mode on the file. 
Use flock() with the %LOCK_MAND flag to set a Share Mode."

However, this doesn't work for me (kernel 2.4.17). /proc/locks shows the 
lock:

1: FLOCK  MSNFS     NONE  17653 03:05:44 0 EOF dfb6b458 c02eb928 
dfb6bb30 000000
00 dfb6b464

but it doesn't seem to be enforced anywhere. other processes can still 
open(2), read(2), write(2). I've skimmed fs/locks.c and for 
locks_may_read() it says:

"* 
N.B. this function is only ever called
  *	from knfsd and ownership of locks is never checked."

It seems to me, LOCK_MAND is not intended to be used outside the kernel. 
is this correct, or am I doing something wrong?

on the other hand, leases work as described.

regards
-- 
O&O Services GmbH - Delivering Value!

Michael Ganß

Am Borsigturm 48, 13507 Berlin, Germany
Tel: +49 30 43 03 43-50 Fax: -99
E-Mail: michael.ganss@oo-services.com
Web: http://www.oo-services.com/

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2002-04-24 11:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CC692D3.7040907@oo-services.com \
    --to=michael.ganss@oo-services.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.