linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@inwind.it>
To: Miao Xie <miaox@cn.fujitsu.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/5] Btrfs: scan all the devices and build the fs device list by btrfs's self
Date: Sat, 06 Sep 2014 13:48:09 +0200	[thread overview]
Message-ID: <540AF479.5050909@inwind.it> (raw)
In-Reply-To: <1409751393-5403-6-git-send-email-miaox@cn.fujitsu.com>

On 09/03/2014 03:36 PM, Miao Xie wrote:
> The original code need scan the devices and build the fs device list by the user
> tool by udev or users' selves. It is flexible. But if someone re-install the
> filesystem module, and forget to scan the devices by himself, or we plug some
> devices with btrfs, but udev thread is blocked and doesn't register the disk
> into btrfs in time, the filesystem would report that "can not open some device"
> when mounting the filesystem, it was uncomfortable, this patch fixes this problem
> by scanning all the devices if we find the number of devices is not right when
> we mount the filesystem.
> 
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
[....]
> +
> +void btrfs_scan_all_devices(void *holder)
> +{
> +	struct class_dev_iter iter;
> +	struct device *dev;
> +	struct gendisk *disk;
> +
> +	mutex_lock(&uuid_mutex);
> +	class_dev_iter_init(&iter, &block_class, NULL, &disk_type);
> +	while ((dev = class_dev_iter_next(&iter))) {
> +		disk = dev_to_disk(dev);
> +
> +		if (!get_capacity(disk) ||
> +		    (!disk_max_parts(disk) &&
> +		     (disk->flags & GENHD_FL_REMOVABLE)))
                                    ^^^^^^^^^^^^^^^^^^
> +			continue;
> +
> +		if (disk->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)
> +			continue;


Hi, could you elaborate why a removable disk should be not scan-ned ? How
a removble usb disk is classified ?

Thanks.
G.Baroncelli

[...]


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli (kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2014-09-06 11:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 13:36 [PATCH RFC 0/5] Scan all devices to build fs device list Miao Xie
2014-09-03 13:36 ` [PATCH 1/5] block: export disk_class and disk_type for btrfs Miao Xie
2014-09-03 13:36 ` [PATCH 2/5] Btrfs: don't return btrfs_fs_devices if the caller doesn't want it Miao Xie
2014-09-03 13:36 ` [PATCH 3/5] Btrfs: restructure btrfs_scan_one_device Miao Xie
2014-09-03 13:36 ` [PATCH 4/5] Btrfs: restructure btrfs_get_bdev_and_sb and pick up some code used later Miao Xie
2014-09-03 13:36 ` [PATCH 5/5] Btrfs: scan all the devices and build the fs device list by btrfs's self Miao Xie
2014-09-06 11:48   ` Goffredo Baroncelli [this message]
2014-09-09  4:06     ` Miao Xie
2014-09-06 20:05 ` [PATCH RFC 0/5] Scan all devices to build fs device list Chris Mason
2014-09-08  9:09   ` David Sterba
2014-09-08 11:04     ` Anand Jain
2014-09-08 17:15       ` Goffredo Baroncelli
2014-09-09  3:26         ` Anand Jain
2014-09-09 20:31           ` Goffredo Baroncelli
2014-09-10  6:06             ` Anand Jain
2014-09-08 16:59     ` Goffredo Baroncelli

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=540AF479.5050909@inwind.it \
    --to=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miaox@cn.fujitsu.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).