linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <jes@trained-monkey.org>
To: Nigel Croxon <ncroxon@redhat.com>, linux-raid@vger.kernel.org
Subject: Re: [PATCH V2] allow RAID5 to grow to RAID6 with a backup_file
Date: Fri, 8 May 2020 10:01:18 -0400	[thread overview]
Message-ID: <8a30b584-753c-abff-634a-7dda8a2e3e27@trained-monkey.org> (raw)
In-Reply-To: <20200505183545.26291-1-ncroxon@redhat.com>

On 5/5/20 2:35 PM, Nigel Croxon wrote:
> This problem came in, as the user did not specify a full path with
> the backup_file option when growing an RAID5 array to RAID6.
> When the full path is specified, the symbolic link is created
> properly (/run/mdadm/backup_file-mdX). But the code did not support
> the symbolic link when looking for the backup_file. Added two
> checks for symlink.
> 
> This addresses https://www.spinics.net/lists/raid/msg48910.html
> and numerous customer reported problems.
> 
> V2:
> - Removed unneeded break; in both case-statements
> - Returned the error checking on call to lstat
> 
> Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
> ---
>  Grow.c | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/Grow.c b/Grow.c
> index 764374f..53245d7 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -1135,6 +1135,15 @@ int reshape_open_backup_file(char *backup_file,
>  	unsigned int dev;
>  	int i;
>  
> +	if (lstat(backup_file, &stb) != -1) {
> +		switch (stb.st_mode & S_IFMT) {
> +		case S_IFLNK:
> +			return 1;
> +		default:
> +			break;
> +		}
> +	}
> +

Sorry for being a pita on this, but in this case you do the thing if the
lstat completes correctly, but what if it fails? In that case we should
error out rather than just continuing.

Jes

  reply	other threads:[~2020-05-08 14:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 18:35 [PATCH V2] allow RAID5 to grow to RAID6 with a backup_file Nigel Croxon
2020-05-08 14:01 ` Jes Sorensen [this message]
2020-05-08 14:50   ` Nigel Croxon
2020-05-12 16:26     ` Nigel Croxon
2020-05-12 18:50       ` Jes Sorensen

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=8a30b584-753c-abff-634a-7dda8a2e3e27@trained-monkey.org \
    --to=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@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;
as well as URLs for NNTP newsgroup(s).