Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp401976pxb; Wed, 3 Feb 2021 08:07:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzt47RVPURLecfKrwRkyX/3qE506GQyPhBls5qgBYivmigWpWD1y63N2zfJJ9StYHZmFUg9 X-Received: by 2002:aa7:c7d8:: with SMTP id o24mr3798876eds.328.1612368443865; Wed, 03 Feb 2021 08:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612368443; cv=none; d=google.com; s=arc-20160816; b=pVqk3Yw0QinScgVcFpW+uTej5x7UJ444ozofFLVacNTxpBdZHAczIuvKtt6wHMG61N sEsS1lSAFQRGiyqNNKkxEcbMV/+Up2FHalGFSoBJ9LbVuT82c9O4wxy14tmWdwupTS2W ThTL8+cEX9LB3jQDc0mezfxKy309zev/4oiUsVskErcO7WyAE/YLGjereHn5XGe0wD50 4VWpHiXXg+uxvoMFIirhDcxvJQp/KVX7cfhUKircQhuQUsRBO67XQTsqJqbBKNHDactB z3oNeG4XFsCGD3yYevN7j5TeUuX1NWr/T2KCvYuoRJEA/T6VmdBhxUfyp+QV/G01ijjC sPhA== 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=TxsiL08lwDvynPRRVYNDsb6qK5Qu59uFKm2sAo0QQ69by+DAiTyjPCBVj+bAzRWYTm J1DNn0VlH2uooNI45rlaUi/lwNYhj4uHpncH655/4Tp4f8AuoknyGEpnGYN2INhFeoJA QMxD8KmRBwxjzpoWAdITgC54LyxXcxECo9ZEuHqCkGLatAsGUAiy+3+YLl3bF19hXBZ5 Qo4DCPsYFIFgJwOEs4c5CCVuiPIxIknIXxQLuh9or23gGHlt4NJXmkimdHEAGPZ4D4xJ r7XH3Mf8z4pmCxDzBmJDePrSXVeoD7x5E6Y/PAXWBm4ZNG4vQea+H6tUg27x0KvUef00 ukvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@veeam.com header.s=mx2 header.b=Cu+rQypw; 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 z7si1605670edm.477.2021.02.03.08.06.59; Wed, 03 Feb 2021 08:07:23 -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=Cu+rQypw; 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 S234769AbhBCQGI (ORCPT + 99 others); Wed, 3 Feb 2021 11:06:08 -0500 Received: from mx2.veeam.com ([64.129.123.6]:40650 "EHLO mx2.veeam.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234720AbhBCQFW (ORCPT ); Wed, 3 Feb 2021 11:05:22 -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 3009441585; Wed, 3 Feb 2021 10:54:53 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veeam.com; s=mx2; t=1612367693; bh=iOyxKFHPVnSJiNEqoIQLb5N7mlhEeMv/ecD8/bTsSt0=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=Cu+rQypwSrNR/OGjg5GfLNWUQxA3We0G2OVdCd5KnehT/KVVe/iAsaSCXZaZWlJDY Ao/VQEAVEVBRBDGOohsmH9IZAENV1Bg/+OyxZooN0W7OF7zPCVhYm9G/E/YuJnqi5c 2hxC7FAnYrQ6lUC4JS29BTXdkwzuB8z0BrVPoJXI= 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; Wed, 3 Feb 2021 16:54:28 +0100 From: Sergei Shtepa To: , , , , , , , , , , , , , , , CC: , Subject: [PATCH v4 6/6] docs: device-mapper: 'noexcl' option for dm-linear Date: Wed, 3 Feb 2021 18:53:58 +0300 Message-ID: <1612367638-3794-7-git-send-email-sergei.shtepa@veeam.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1612367638-3794-1-git-send-email-sergei.shtepa@veeam.com> References: <1612367638-3794-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: 37303A29C604D265667062 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