From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: Does mandatory locking need to be set when the file is locked? Date: Mon, 15 Dec 2003 15:38:58 +0000 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20031215153858.GE15674@parcelfarce.linux.theplanet.co.uk> References: <200312150757.57021.theman@josephdwagner.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:65186 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S263653AbTLOPi7 (ORCPT ); Mon, 15 Dec 2003 10:38:59 -0500 To: "Joseph D. Wagner" Content-Disposition: inline In-Reply-To: <200312150757.57021.theman@josephdwagner.info> List-Id: linux-fsdevel.vger.kernel.org On Mon, Dec 15, 2003 at 07:57:57AM +0600, Joseph D. Wagner wrote: > I'm writing a program that changes the permissions on a file to enable > mandatory locking, does its thing to the file, and then resets the > permissions. > > Do do the mandatory locking permissions have to be set before the lock is > set? Or will the kernel dynamically recognize the change on the fly so that > an active lock becomes mandatory? Please, don't use mandatory locking. It's racy (by design), buggy (by design) and adds code to the fast path. -- "Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain