Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp708623ybz; Wed, 15 Apr 2020 17:11:57 -0700 (PDT) X-Google-Smtp-Source: APiQypJyq4sTUj2hcwNT4ynUynvCnDkRbB6HORYt9j/Vy1FJVL1l4k8ymZPQhvSzOsbp0Ft3HVeS X-Received: by 2002:a17:906:4e8f:: with SMTP id v15mr6027864eju.321.1586995916865; Wed, 15 Apr 2020 17:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586995916; cv=none; d=google.com; s=arc-20160816; b=wIJW8674PkHJkT3Yjmo0iLEZRkdWYTMEf9VZhF/FN30GZCIdgX8/VeHm8911Tq96xU pGVwxHDAf73AM4LzPPGWs9ruqUpqvPClyck5DhWrAB2z8nDFOfiI/Wdr4/l3gXUA5pNd vfTKds38y372AI9frU1JmX7KGBsAunJV/+V7LO9r1U4LTe2qTi1sOfv+hx92Y4bFhvAG A1jPURCk48ovm0UwY3k/IpmrGSOvn8TN2Yw0eFB3eE/mDmELv2Pm16Mi5c1tMHC3jBkE ODE7+X6rC4rVTGDTd1kADwSIaoTlqHiUQRtYcYmUPW2KvJUxvXB+IN2dHR0v/JDtGQge vn3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e78WWuaYKpxsrW1rPdm2WhJ83/sSMr9AB0u1cA8apcc=; b=TaR9FO7fYiBuO+FaF8pUs+UJQK6PSMRKg53IU3Ptgcx33A177/kUvw03YZMzSLNng4 KFLHqHVfV/8hD2RqNjTNNHUnf1+LFrTYXIIiyNCiSIobY+hVDvYZr5LptkLw8tWgzzOV GitRxWU4FRNKUOylYPNSCAZsfLv6Dqo9aWkMpvQ0vqB7BYcGgKOle/u0ygS5WzF46q2o s8sHXaOQc+aIVke/bRRD8x67MIaBA0dfiR2fYGu7NOMS0rngpBCvqkCN8xhAFEhyvmiQ UFncv0mgsin7ySHTaXbWWYSyuwIRcuoNicorSJeG8LmNdhLGWPEnia9HmSA6XIQTS8zT Qk2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kEXCq8eg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f20si11735240ejk.282.2020.04.15.17.11.33; Wed, 15 Apr 2020 17:11:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kEXCq8eg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S370801AbgDOOj3 (ORCPT + 99 others); Wed, 15 Apr 2020 10:39:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394078AbgDOOdD (ORCPT ); Wed, 15 Apr 2020 10:33:03 -0400 Received: from mail.kernel.org (ip5f5ad4d8.dynamic.kabel-deutschland.de [95.90.212.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 764D221D7A; Wed, 15 Apr 2020 14:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586961171; bh=J2VLKHFfGYVorzlk/8UwKCJP0drKzZlIAdlBq85Rcx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kEXCq8egdQ1CKEBOz9gAN5XiwALqK5M3P3qyK3Vgogo/eS3VUMtSqMKvcNX1rTSq7 Us9SbcQnW5+nYHNUZiaW2Dkrm0D/zkkRszoRs6VnpqecvPm5YRGpEdBvkrQzKgPoqi RTaYAjUpVWw69LM7W3NYM2vtqMNB6RMo+4V5Bwu0= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jOj5t-006kPH-NH; Wed, 15 Apr 2020 16:32:49 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Jeff Layton , "J. Bruce Fields" , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH 20/34] docs: filesystems: convert mandatory-locking.txt to ReST Date: Wed, 15 Apr 2020 16:32:33 +0200 Message-Id: <289e82f172907dedabc67f3a5124840544f87b22.1586960617.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Use notes markups; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/filesystems/index.rst | 1 + Documentation/filesystems/locks.rst | 2 +- ...tory-locking.txt => mandatory-locking.rst} | 25 ++++++++++++------- fs/locks.c | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) rename Documentation/filesystems/{mandatory-locking.txt => mandatory-locking.rst} (91%) diff --git a/Documentation/filesystems/index.rst b/Documentation/filesystems/index.rst index 40cdc4ce2ffc..32759666a0be 100644 --- a/Documentation/filesystems/index.rst +++ b/Documentation/filesystems/index.rst @@ -30,6 +30,7 @@ algorithms work. fiemap files locks + mandatory-locking automount-support diff --git a/Documentation/filesystems/locks.rst b/Documentation/filesystems/locks.rst index 10f67fb9ce07..c5ae858b1aac 100644 --- a/Documentation/filesystems/locks.rst +++ b/Documentation/filesystems/locks.rst @@ -58,7 +58,7 @@ fcntl(), with all the problems that implies. --------------------------------------- Mandatory locking, as described in -'Documentation/filesystems/mandatory-locking.txt' was prior to this release a +'Documentation/filesystems/mandatory-locking.rst' was prior to this release a general configuration option that was valid for all mounted filesystems. This had a number of inherent dangers, not the least of which was the ability to freeze an NFS server by asking it to read a file for which a mandatory lock diff --git a/Documentation/filesystems/mandatory-locking.txt b/Documentation/filesystems/mandatory-locking.rst similarity index 91% rename from Documentation/filesystems/mandatory-locking.txt rename to Documentation/filesystems/mandatory-locking.rst index a251ca33164a..9ce73544a8f0 100644 --- a/Documentation/filesystems/mandatory-locking.txt +++ b/Documentation/filesystems/mandatory-locking.rst @@ -1,8 +1,13 @@ - Mandatory File Locking For The Linux Operating System +.. SPDX-License-Identifier: GPL-2.0 + +===================================================== +Mandatory File Locking For The Linux Operating System +===================================================== Andy Walker 15 April 1996 + (Updated September 2007) 0. Why you should avoid mandatory locking @@ -53,15 +58,17 @@ possible on existing user code. The scheme is based on marking individual files as candidates for mandatory locking, and using the existing fcntl()/lockf() interface for applying locks just as if they were normal, advisory locks. -Note 1: In saying "file" in the paragraphs above I am actually not telling -the whole truth. System V locking is based on fcntl(). The granularity of -fcntl() is such that it allows the locking of byte ranges in files, in addition -to entire files, so the mandatory locking rules also have byte level -granularity. +.. Note:: -Note 2: POSIX.1 does not specify any scheme for mandatory locking, despite -borrowing the fcntl() locking scheme from System V. The mandatory locking -scheme is defined by the System V Interface Definition (SVID) Version 3. + 1. In saying "file" in the paragraphs above I am actually not telling + the whole truth. System V locking is based on fcntl(). The granularity of + fcntl() is such that it allows the locking of byte ranges in files, in + addition to entire files, so the mandatory locking rules also have byte + level granularity. + + 2. POSIX.1 does not specify any scheme for mandatory locking, despite + borrowing the fcntl() locking scheme from System V. The mandatory locking + scheme is defined by the System V Interface Definition (SVID) Version 3. 2. Marking a file for mandatory locking --------------------------------------- diff --git a/fs/locks.c b/fs/locks.c index b8a31c1c4fff..1d4f4d5da704 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -61,7 +61,7 @@ * * Initial implementation of mandatory locks. SunOS turned out to be * a rotten model, so I implemented the "obvious" semantics. - * See 'Documentation/filesystems/mandatory-locking.txt' for details. + * See 'Documentation/filesystems/mandatory-locking.rst' for details. * Andy Walker (andy@lysaker.kvaerner.no), April 06, 1996. * * Don't allow mandatory locks on mmap()'ed files. Added simple functions to -- 2.25.2