From: Csaba H. <cs...@gl...> - 2009-12-16 12:46:27
|
Hi Miklós, I have two concerns regarding mandatory locking: 1) How is the fuse server expected to use the interface? As of now, there are the per-message owner fields + flags for presence of an owner, for SETATTR, READ, WRITE. This should be used for the mandatory lock implementation. Yep we know the exact conditions for getting an owner value in this messages -- for SETATTR, it comes if size is to be changed, for READ/WRITE, it comes when the file is opened in direct mode. However, these conditions seem belong to the implementation domain, in which case relying on them would be an abuse of the interface. So then, when a file is subject to mandatory locking -- ie,. mount has "-omand", and the file has no-gid-exec + setgid mode --, upon handling a SETLK[W] message, we should decide if we can support it or not. On what base could we do that? AFAICS we'd rather need a per-open flag for mandatory lock support, and not per-message flags. 2) OK, suppose that we have a sufficient answer to 1) (or we unabashedly abuse the interface by checking direct IO, or maybe you declare that indeed direct mode _is_ the appropriate sign of availability of mandatory locking). Now see my direct I/O related modifications -- they allow to switch direct mode on/off by the fs user, by means of fcntl(F_SETFL). How to modify its design so that a mandatory locks of Alice cannot be defeated by her competitor Bob who just fcntls off direct mode from the file on which Alice has placed the lock? Csaba |