Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp533258pxb; Tue, 9 Feb 2021 06:37:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6url2zs4XAMKqUYQ4uQf/Isnp0CrXl1hN7lBpZkHbKEtAy3KTtMGWkLlBFAYsqdETj/1Z X-Received: by 2002:a05:6000:100f:: with SMTP id a15mr3863397wrx.212.1612881446744; Tue, 09 Feb 2021 06:37:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612881446; cv=none; d=google.com; s=arc-20160816; b=SVFe7hlDMWiLpqbS/z0jx2GgVKQ6gvRrWhC9NC+jXB1NJKbcSe0kZTJ6igH8etIvhP gR0GzMbbau8DMZLXfR8SXv50SBG/kZ2G+0ovZ+ioprefpYw0oSsuFRkS+VuKJjJ8GV27 1SYjd3X13WoLcG3lRme4RRKjpe3pLRoTUoKEfO9V5qISjxBIVfcGu5R3mwdiouEyUcon 3GTJrZvRhOETZxDDKiSA7FMKILoP9lP2S8rJcEkVN3SgOskDfGEZx0AfSqRbu/h37QNk x7fH7iE8CSocSzadPMzknyAOLqJu/6kUXczWq4wkVb9566mAFP+NPtuQcmuqU/BFBATs 1JtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=iOyxKFHPVnSJiNEqoIQLb5N7mlhEeMv/ecD8/bTsSt0=; b=PToDN9pM8KsRzpdrRiIMhENwrhYLd+5j8agxTGdOJL0DQPM+5ap+GSFpLJCmZF7EE1 VnWsg/Pg975KNKo94oZNRhg3upHcfQZrGe1cj/6GOmlzAQPaYQXeXVRisi7j7sLRfJ4M Le+J0zmCJKICVisqPL996baFFCnCca6uYWP0cXQAIx00D6cXyxeZIPy/vj7HrGY1G3yc cbXuTTtXHRW4oR7mKDZFpWFiJO0eENw7ainhK92zQ8A4SSqA0mdszFAezlksXRCjZgEj fRxr7sv3z4OcF2MW9SsWpeJQQ7/eM9oQY3kJwU2rZuMz2I8OfGY7QEkF8+RnKzinlb4l UymQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@veeam.com header.s=mx2 header.b=EJi2swXf; 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=REJECT sp=REJECT dis=NONE) header.from=veeam.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si13470229eds.376.2021.02.09.06.37.01; Tue, 09 Feb 2021 06:37:26 -0800 (PST) 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=@veeam.com header.s=mx2 header.b=EJi2swXf; 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=REJECT sp=REJECT dis=NONE) header.from=veeam.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232076AbhBIOcz (ORCPT + 99 others); Tue, 9 Feb 2021 09:32:55 -0500 Received: from mx2.veeam.com ([64.129.123.6]:55760 "EHLO mx2.veeam.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbhBIOca (ORCPT ); Tue, 9 Feb 2021 09:32:30 -0500 Received: from mail.veeam.com (prgmbx01.amust.local [172.24.0.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.veeam.com (Postfix) with ESMTPS id 6AF154141F; Tue, 9 Feb 2021 09:31:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veeam.com; s=mx2; t=1612881074; bh=iOyxKFHPVnSJiNEqoIQLb5N7mlhEeMv/ecD8/bTsSt0=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=EJi2swXfmkqGcb7cjVWZJ/3bBW0j9ANhODuOdQENhciXXuSAoVarVi9ek4yhuXdkL FJjKFaaRKbZeQ1AKEohOVGTJclTFqLULWm8yM8yrkbL+A5m3lRnuaqpXbBNcTBtCK5 CTEr9VnxNrVz3tuhlyUcAkBjR939aeCRw6QCC6FU= Received: from prgdevlinuxpatch01.amust.local (172.24.14.5) by prgmbx01.amust.local (172.24.0.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.721.2; Tue, 9 Feb 2021 15:30:53 +0100 From: Sergei Shtepa To: , , , , , , , , , , , , , , , CC: , Subject: [PATCH v5 6/6] docs: device-mapper: 'noexcl' option for dm-linear Date: Tue, 9 Feb 2021 17:30:28 +0300 Message-ID: <1612881028-7878-7-git-send-email-sergei.shtepa@veeam.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612881028-7878-1-git-send-email-sergei.shtepa@veeam.com> References: <1612881028-7878-1-git-send-email-sergei.shtepa@veeam.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.24.14.5] X-ClientProxiedBy: prgmbx02.amust.local (172.24.0.172) To prgmbx01.amust.local (172.24.0.171) X-EsetResult: clean, is OK X-EsetId: 37303A29C604D265617465 X-Veeam-MMEX: True Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org New 'noexcl' option allow to open underlying block-device without FMODE_EXCL flag. Signed-off-by: Sergei Shtepa --- .../admin-guide/device-mapper/linear.rst | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/device-mapper/linear.rst b/Documentation/admin-guide/device-mapper/linear.rst index 9d17fc6e64a9..f035cd7ad78c 100644 --- a/Documentation/admin-guide/device-mapper/linear.rst +++ b/Documentation/admin-guide/device-mapper/linear.rst @@ -6,12 +6,22 @@ Device-Mapper's "linear" target maps a linear range of the Device-Mapper device onto a linear range of another device. This is the basic building block of logical volume managers. -Parameters: +Parameters: [] : - Full pathname to the underlying block-device, or a + Full pathname to the underlying block-device, or a "major:minor" device-number. : - Starting sector within the device. + Starting sector within the device. + : + Options allow to set the exclusivity mode. The exclusivity mode + can be 'excl' and 'noexcl'. By default, then options is not set, + the 'excl' mode is used. 'noexcl' mode allow to open device + without FMODE_EXCL flag. This allow to create liner device with + underlying block-device that are already used by the system. For + example, the file system on this device is already mounted. + The 'noexcl' option should be used when creating dm devices that + will be used as acceptor when connecting the device mapper to an + existing block device with the 'dmsetup remap' command. Example scripts @@ -61,3 +71,13 @@ Example scripts } `echo \"$table\" | dmsetup create $name`; + +:: + + #!/bin/sh + # Create linear device and remap all requests from the original device + # to new linear. + DEV=$1 + + echo "0 `blockdev --getsz $DEV` linear $DEV 0 noexcl" | dmsetup create dm-noexcl + dmsetup remap start dm-noexcl $DEV -- 2.20.1