linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Christoph Hellwig <hch@lst.de>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/2] blkmapd: dump useful device information to syslog
Date: Wed, 13 Aug 2014 10:54:15 -0400	[thread overview]
Message-ID: <53EB7C17.8050402@RedHat.com> (raw)
In-Reply-To: <1407396409-5036-3-git-send-email-hch@lst.de>



On 08/07/2014 03:26 AM, Christoph Hellwig wrote:
> Dump some information about used devices to syslog so that an admin
> can troubleshoot failing blocklayout mounts.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Committed... after fixing a couple format warnings... 

steved.

> ---
>  utils/blkmapd/device-discovery.c | 6 +++++-
>  utils/blkmapd/device-process.c   | 2 ++
>  utils/blkmapd/dm-device.c        | 4 ++++
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c
> index bcfb060..b52afe2 100644
> --- a/utils/blkmapd/device-discovery.c
> +++ b/utils/blkmapd/device-discovery.c
> @@ -148,7 +148,11 @@ void bl_add_disk(char *filepath)
>  
>  	dev = sb.st_rdev;
>  	serial = bldev_read_serial(fd, filepath);
> -	if (dm_is_dm_major(major(dev)))
> +	if (!serial) {
> +		BL_LOG_ERR("%s: no serial found for %s\n",
> +				 __func__, filepath);
> +		ap_state = BL_PATH_STATE_PASSIVE;
> +	} else if (dm_is_dm_major(major(dev)))
>  		ap_state = BL_PATH_STATE_PSEUDO;
>  	else
>  		ap_state = bldev_read_ap_state(fd);
> diff --git a/utils/blkmapd/device-process.c b/utils/blkmapd/device-process.c
> index 5fe3dff..f53a616 100644
> --- a/utils/blkmapd/device-process.c
> +++ b/utils/blkmapd/device-process.c
> @@ -181,6 +181,8 @@ static int map_sig_to_device(struct bl_sig *sig, struct bl_volume *vol)
>  		/* FIXME: should we use better algorithm for disk scan? */
>  		mapped = verify_sig(disk, sig);
>  		if (mapped) {
> +			BL_LOG_INFO("%s: using device %s\n",
> +					__func__, disk->valid_path->full_path);
>  			vol->param.bv_dev = disk->dev;
>  			vol->bv_size = disk->size;
>  			break;
> diff --git a/utils/blkmapd/dm-device.c b/utils/blkmapd/dm-device.c
> index 0f4f148..8ffb19e 100644
> --- a/utils/blkmapd/dm-device.c
> +++ b/utils/blkmapd/dm-device.c
> @@ -400,6 +400,8 @@ uint64_t dm_device_create(struct bl_volume *vols, int num_vols)
>  			}
>  			dev = node->bv_vols[0]->param.bv_dev;
>  			tmp = table->params;
> +			BL_LOG_INFO("%s: major %u minor %u", __func__,
> +					MAJOR(dev), MINOR(dev));
>  			if (!dm_format_dev(tmp, DM_PARAMS_LEN,
>  					   MAJOR(dev), MINOR(dev))) {
>  				free(table);
> @@ -459,6 +461,8 @@ uint64_t dm_device_create(struct bl_volume *vols, int num_vols)
>  				strcpy(table->target_type, "linear");
>  				tmp = table->params;
>  				dev = node->bv_vols[i]->param.bv_dev;
> +				BL_LOG_INFO("%s: major %u minor %u", __func__,
> +					MAJOR(dev), MINOR(dev));
>  				if (!dm_format_dev(tmp, DM_PARAMS_LEN,
>  						   MAJOR(dev), MINOR(dev))) {
>  					free(table);
> 

      reply	other threads:[~2014-08-13 14:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07  7:26 nfs-utils: blkmapd fixex Christoph Hellwig
2014-08-07  7:26 ` [PATCH 1/2] blkmapd: fix broken multipath handling Christoph Hellwig
2014-08-13 14:53   ` Steve Dickson
2014-08-07  7:26 ` [PATCH 2/2] blkmapd: dump useful device information to syslog Christoph Hellwig
2014-08-13 14:54   ` Steve Dickson [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=53EB7C17.8050402@RedHat.com \
    --to=steved@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-nfs@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).