From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz
Cc: fstests@vger.kernel.org, fdmanana@kernel.org,
linux-btrfs@vger.kernel.org, zlang@redhat.com
Subject: Re: [PATCH v4 1/5] common/rc: _fs_sysfs_dname fetch fsid using btrfs tool
Date: Fri, 3 Nov 2023 07:01:36 +0800 [thread overview]
Message-ID: <189e8ca6-450e-4908-9fec-b55cbf7d064d@oracle.com> (raw)
In-Reply-To: <20231102200040.GH11264@twin.jikos.cz>
On 11/3/23 04:00, David Sterba wrote:
> On Thu, Nov 02, 2023 at 07:28:18PM +0800, Anand Jain wrote:
>> Currently _fs_sysfs_dname gets fsid from the findmnt command however
>> this command provides the metadata_uuid if the device is mounted with
>> temp-fsid. So instead, use btrfs filesystem show command to know the fsid.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> Reviewed-by: Filipe Manana <fdmanana@suse.com>
>> ---
>> v3: add local variable fsid
>>
>> common/rc | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/common/rc b/common/rc
>> index 259a1ffb09b9..7f14c19ca89e 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -4721,6 +4721,7 @@ _require_statx()
>> _fs_sysfs_dname()
>> {
>> local dev=$1
>> + local fsid
>>
>> if [ ! -b "$dev" ]; then
>> _fail "Usage: _fs_sysfs_dname <mounted_device>"
>> @@ -4728,7 +4729,9 @@ _fs_sysfs_dname()
>>
>> case "$FSTYP" in
>> btrfs)
>> - findmnt -n -o UUID ${dev} ;;
>> + fsid=$($BTRFS_UTIL_PROG filesystem show ${dev} | grep uuid: | \
>> + $AWK_PROG '{print $NF}')
>
> This could be also added as a subcommand to 'inspect-internal', ie. from
> a file to it's filesystem uuid, then it should be easy to get any other
> id if needed through the sysfs directory.
Thanks for the feedback. I'll create a separate patch for the
'get_btrfs_fsid' helper, making it possible to merge this series
with RB.
Thanks Anand
next prev parent reply other threads:[~2023-11-02 23:02 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 14:15 [PATCH 0/6 v3] btrfs/219 cloned-device mount capability update Anand Jain
2023-10-30 14:15 ` [PATCH 1/6 v3] common/rc: _fs_sysfs_dname fetch fsid using btrfs tool Anand Jain
2023-10-30 16:16 ` Filipe Manana
2023-10-30 23:48 ` Anand Jain
2023-10-30 14:15 ` [PATCH 2/6 v3] common/rc: _destroy_loop_device confirm arg1 is set Anand Jain
2023-10-30 16:21 ` Filipe Manana
2023-10-30 23:48 ` Anand Jain
2023-10-30 14:15 ` [PATCH 3/6 v3] common/btrfs: add helper _has_btrfs_sysfs_feature_attr Anand Jain
2023-10-30 16:23 ` Filipe Manana
2023-10-30 23:29 ` Anand Jain
2023-10-31 11:34 ` Filipe Manana
2023-10-30 14:15 ` [PATCH 4/6 v3] btrfs/219: fix _cleanup() to successful release the loop-device Anand Jain
2023-10-30 16:29 ` Filipe Manana
2023-11-02 11:28 ` [PATCH v4 0/5] btrfs/219 cloned-device mount capability update Anand Jain
2023-10-31 0:53 ` [PATCH v4 3/5] btrfs/219: fix _cleanup() to successful release the loop-device Anand Jain
2023-10-31 11:41 ` Filipe Manana
2023-10-31 14:32 ` Anand Jain
2023-11-01 11:20 ` Zorro Lang
2023-11-02 11:37 ` Anand Jain
2023-11-02 11:28 ` Anand Jain
2023-11-02 11:28 ` [PATCH v4 1/5] common/rc: _fs_sysfs_dname fetch fsid using btrfs tool Anand Jain
2023-11-02 20:00 ` David Sterba
2023-11-02 23:01 ` Anand Jain [this message]
2023-11-02 11:28 ` [PATCH v4 2/5] common/btrfs: add helper _has_btrfs_sysfs_feature_attr Anand Jain
2023-11-02 11:28 ` [PATCH v4 4/5] btrfs/219: cloned-device mount capability update Anand Jain
2023-11-02 11:28 ` [PATCH v4 5/5] btrfs/219: add to the auto group Anand Jain
2023-10-30 14:15 ` [PATCH 5/6 v3] btrfs/219: cloned-device mount capability update Anand Jain
2023-10-30 16:31 ` Filipe Manana
2023-10-30 14:15 ` [PATCH 6/6 v3] btrfs/219: add to the auto group Anand Jain
2023-10-30 16:32 ` Filipe Manana
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=189e8ca6-450e-4908-9fec-b55cbf7d064d@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=fdmanana@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=zlang@redhat.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