From: Sergei Shtepa <sergei.shtepa@veeam.com>
To: <Damien.LeMoal@wdc.com>, <snitzer@redhat.com>, <hare@suse.de>,
<ming.lei@redhat.com>, <agk@redhat.com>, <corbet@lwn.net>,
<axboe@kernel.dk>, <jack@suse.cz>, <johannes.thumshirn@wdc.com>,
<gregkh@linuxfoundation.org>, <koct9i@gmail.com>, <steve@sk2.org>,
<dm-devel@redhat.com>, <linux-block@vger.kernel.org>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <sergei.shtepa@veeam.com>, <pavel.tide@veeam.com>
Subject: [PATCH v5 6/6] docs: device-mapper: 'noexcl' option for dm-linear
Date: Tue, 9 Feb 2021 17:30:28 +0300 [thread overview]
Message-ID: <1612881028-7878-7-git-send-email-sergei.shtepa@veeam.com> (raw)
In-Reply-To: <1612881028-7878-1-git-send-email-sergei.shtepa@veeam.com>
New 'noexcl' option allow to open underlying block-device
without FMODE_EXCL flag.
Signed-off-by: Sergei Shtepa <sergei.shtepa@veeam.com>
---
.../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: <dev path> <offset>
+Parameters: <dev path> <offset> [<options>]
<dev path>:
- Full pathname to the underlying block-device, or a
+ Full pathname to the underlying block-device, or a
"major:minor" device-number.
<offset>:
- Starting sector within the device.
+ Starting sector within the device.
+ <options>:
+ 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
prev parent reply other threads:[~2021-02-09 14:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 14:30 [PATCH v5 0/6] block-layer interposer Sergei Shtepa
2021-02-09 14:30 ` [PATCH v5 1/6] docs: device-mapper: add remap_and_filter Sergei Shtepa
2021-02-09 14:30 ` [PATCH v5 2/6] block: add blk_mq_is_queue_frozen() Sergei Shtepa
2021-02-09 14:30 ` [PATCH v5 3/6] block: add blk_interposer Sergei Shtepa
2021-02-09 14:30 ` [PATCH v5 4/6] dm: new ioctl DM_DEV_REMAP_CMD Sergei Shtepa
2021-02-12 16:13 ` Mike Snitzer
2021-02-09 14:30 ` [PATCH v5 5/6] dm: add 'noexcl' option for dm-linear Sergei Shtepa
2021-02-11 17:51 ` Mike Snitzer
2021-02-12 11:34 ` Sergei Shtepa
2021-02-12 16:06 ` Mike Snitzer
2021-02-15 10:34 ` Sergei Shtepa
2021-02-15 16:08 ` Mike Snitzer
2021-02-24 10:46 ` Sergei Shtepa
2021-02-09 14:30 ` Sergei Shtepa [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1612881028-7878-7-git-send-email-sergei.shtepa@veeam.com \
--to=sergei.shtepa@veeam.com \
--cc=Damien.LeMoal@wdc.com \
--cc=agk@redhat.com \
--cc=axboe@kernel.dk \
--cc=corbet@lwn.net \
--cc=dm-devel@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=hare@suse.de \
--cc=jack@suse.cz \
--cc=johannes.thumshirn@wdc.com \
--cc=koct9i@gmail.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=pavel.tide@veeam.com \
--cc=snitzer@redhat.com \
--cc=steve@sk2.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).