All of lore.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, linux-btrfs@vger.kernel.org,
	dsterba@suse.cz, guaneryu@gmail.com
Subject: Re: [PATCH v2] fstests: btrfs: try use forget to unregister device
Date: Fri, 26 Apr 2019 18:35:42 +0200	[thread overview]
Message-ID: <20190426163542.GW20156@twin.jikos.cz> (raw)
In-Reply-To: <20190402081946.24838-1-anand.jain@oracle.com>

On Tue, Apr 02, 2019 at 04:19:46PM +0800, Anand Jain wrote:
> Some btrfs test cases use btrfs module-reload to unregister devices in
> the btrfs kernel. The problem with the module-reload approach is, if test
> system contains btrfs as rootfs, then you can't run these test cases.
> 
> Patches [1] introduced btrfs forget feature which can unregister devices
> without the module-reload approach.
> 
>  [1]
>  btrfs-progs: device scan: add new option to forget one or all scanned devices
>  btrfs: introduce new ioctl to unregister a btrfs device
> 
> And this patch makes relevant changes in the fstests to use this new
> feature, when available.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> v2:
>  Update change log.
>  Rename _require_btrfs_forget_if_not_fs_loadable() to _require_btrfs_forget_or_module_loadable()
>  Rename _btrfs_forget_if_not_fs_reload() to _btrfs_forget_or_module_reload()

Reviewed-by: David Sterba <dsterba@suse.com>

> +_require_btrfs_forget_or_module_loadable()
> +{
> +	_btrfs_supports_forget && return
> +
> +	_require_loadable_fs_module "btrfs"
> +}
> +
> +_btrfs_forget_or_module_reload()
> +{
> +	_btrfs_supports_forget && return
> +
> +	_reload_fs_module "btrfs"
> +}

The extra return mentioned in v1 is probably just a matter of coding
style so I don't mind as long as it works.

  reply	other threads:[~2019-04-26 16:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  9:49 [PATCH] fstests: btrfs try use forget to unregister device Anand Jain
2019-03-23  9:05 ` Eryu Guan
2019-03-28 17:50 ` David Sterba
2019-03-29  6:32   ` Anand Jain
2019-04-02  8:19 ` [PATCH v2] fstests: btrfs: " Anand Jain
2019-04-26 16:35   ` David Sterba [this message]
2019-05-03 11:14     ` Eryu Guan

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=20190426163542.GW20156@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.