From: David Teigland <teigland@redhat.com>
To: "heming.zhao" <heming.zhao@suse.com>
Cc: linux-lvm@redhat.com, Zdenek Kabelac <zdenek.kabelac@gmail.com>
Subject: Re: [linux-lvm] [PATCH] lvs: add -o lv_usable
Date: Tue, 8 Sep 2020 12:47:44 -0500 [thread overview]
Message-ID: <20200908174744.GD31357@redhat.com> (raw)
In-Reply-To: <c5d20f7f-e3f6-6d92-5b79-b73dc167d679@suse.com>
On Tue, Sep 08, 2020 at 02:40:43PM +0800, heming.zhao wrote:
> Does it acceptable to add new status bit in lv->status?
> I ever sent it in previoud patch "[PATCH v2] lib/metadata: add new api lv_is_available()"
> The define as below (the 'NOT_AVAIL_LV' will change to 'NOT_USABLE_LV'):
> ```
> +#define NOT_AVAIL_LV UINT64_C(0x0000000080000000) /* LV - derived flag, not
> + written out in metadata*/
>
> +#define lv_is_available(lv) (((lv)->status & NOT_AVAIL_LV) ? 0 : 1)
> ```
>
> some description about the new patch:
> - it will combine with two patches:
> - [PATCH v2] lib/metadata: add new api lv_is_available()
> - [PATCH] lvs: add -o lv_usable
> - the new patch will add new status bit NOT_USABLE_LV, and this bit will be
> set in _lv_mark_if_partial_single().
> - The only output which related with new status bit: lvs -o lv_usable
>
> if above is acceptable, I will send the v2 patch. if not, I will give up this 'lv_usable' patch.
That sounds better, the old patch was closer to what we need. It can look
at the PVs listed for the LV in the metadata, and check if those PVs have
a device on the system (pv->dev is set) and are not flagged missing.
device mapper state would not be needed for that (lv_mapping_table
dm_has_lvdev functions are not needed.)
To report info about the active state of LVs is more complex and requires
different sort of code as Zdenek mentioned.
Dave
next prev parent reply other threads:[~2020-09-08 17:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-05 9:06 [linux-lvm] [PATCH] lvs: add -o lv_usable Zhao Heming
2020-09-05 9:08 ` heming.zhao
2020-09-07 14:32 ` Zdenek Kabelac
2020-09-08 6:40 ` heming.zhao
2020-09-08 17:47 ` David Teigland [this message]
2020-09-05 9:17 ` heming.zhao
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=20200908174744.GD31357@redhat.com \
--to=teigland@redhat.com \
--cc=heming.zhao@suse.com \
--cc=linux-lvm@redhat.com \
--cc=zdenek.kabelac@gmail.com \
/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).