public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Anand Jain <anand.jain@oracle.com>
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: Thu, 2 Nov 2023 21:00:40 +0100	[thread overview]
Message-ID: <20231102200040.GH11264@twin.jikos.cz> (raw)
In-Reply-To: <d63c4427d1dc9db3c18a07cb9098459de242fbd3.1698712764.git.anand.jain@oracle.com>

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.

  reply	other threads:[~2023-11-02 20:07 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 [this message]
2023-11-02 23:01           ` Anand Jain
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=20231102200040.GH11264@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.com \
    --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