From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v14] Add cli and ioctl to forget scanned device(s)
Date: Thu, 7 Feb 2019 06:13:32 +0800 [thread overview]
Message-ID: <1b208c60-c207-67b7-c59d-26bfa46ac991@oracle.com> (raw)
In-Reply-To: <20190206153326.GD2900@twin.jikos.cz>
On 2/6/19 11:33 PM, David Sterba wrote:
> On Fri, Jan 04, 2019 at 01:31:51PM +0800, Anand Jain wrote:
>> Adds cli and ioctl to forget a scanned device or forget all stale
>> devices in the kernel.
>>
>> Anand Jain (2):
>> btrfs: refactor btrfs_free_stale_devices() to get return value
>> btrfs: introduce feature to forget a btrfs device
>
> The 2nd patch has been added to misc-next too, I've updated the
> changelog a bit.
Thanks.
> The usecase here is quite small so I don't think we've
> missed something crucial on the kernel side.
> The userspace part can
> provide some convenience shortcuts like --forget-all
The --forget is already equivalent to --forget-all. For example..
# btrfs dev scan /dev/sdb
Scanning for Btrfs filesystems in '/dev/sdb'
# btrfs dev scan --forget /dev/sdb
# btrfs dev scan
Scanning for Btrfs filesystems
# btrfs dev scan --forget
# echo $?
0
# btrfs dev scan --forget /dev/sdb
ERROR: Can't forget '/dev/sdb': No such file or directory
# echo $?
1
#
> or specifying by
> filesystem id where the translation would happen internally, but the
> ioctl would cover that. Thanks.
Looks like that seeks the complete enhancement to scan cli.
IMO we could add..
#btrfs dev scan --show
For which looks like we need to enhance existing ioctl
BTRFS_IOC_FS_INFO and BTRFS_IOC_DEV_INFO so that it works
through btrfs-control.
Which means 'btrfs fi show' can also show the scanned devices from
the kernel, probably we should just add flags to the output to indicate
if the fsid-device is mounted.
OR a wrapper around the sysfs fs-dev tree implementation will suffice
as well.
further, (fsid translation happens internally)
#btrfs dev scan <fsid>
#btrfs dev scan --forget <fsid>
In general, agree use case is limited.
Thanks, Anand
prev parent reply other threads:[~2019-02-06 22:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-04 5:31 [PATCH v14] Add cli and ioctl to forget scanned device(s) Anand Jain
2019-01-04 5:31 ` [PATCH v14] btrfs-progs: add cli to forget one or all scanned devices Anand Jain
2019-01-04 5:31 ` [PATCH 1/2 v14] btrfs: refactor btrfs_free_stale_devices() to get return value Anand Jain
2019-01-18 17:47 ` David Sterba
2019-01-04 5:31 ` [PATCH 2/2 v14] btrfs: introduce feature to forget a btrfs device Anand Jain
2019-01-04 15:13 ` [PATCH v14] Add cli and ioctl to forget scanned device(s) David Sterba
2019-01-07 17:28 ` David Sterba
2019-01-08 5:16 ` Anand Jain
2019-02-06 15:28 ` David Sterba
2019-02-06 15:33 ` David Sterba
2019-02-06 22:13 ` Anand Jain [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=1b208c60-c207-67b7-c59d-26bfa46ac991@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.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).