All of lore.kernel.org
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: linux-raid@vger.kernel.org, Jes Sorensen <jes@trained-monkey.org>
Cc: Guoqing Jiang <guoqing.jiang@linux.dev>, Xiao Ni <xni@redhat.com>,
	Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>,
	Coly Li <colyli@suse.de>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	Jonmichael Hands <jm@chia.net>,
	Stephen Bates <sbates@raithlin.com>,
	Martin Oliveira <Martin.Oliveira@eideticom.com>,
	David Sloan <David.Sloan@eideticom.com>,
	Logan Gunthorpe <logang@deltatee.com>,
	Kinga Tanska <kinga.tanska@linux.intel.com>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH mdadm v7 1/7] Create: goto abort_locked instead of return 1 in error path
Date: Wed,  1 Mar 2023 13:41:29 -0700	[thread overview]
Message-ID: <20230301204135.39230-2-logang@deltatee.com> (raw)
In-Reply-To: <20230301204135.39230-1-logang@deltatee.com>

The return 1 after the fstat_is_blkdev() check should be replaced
with an error return that goes through the error path to unlock
resources locked by this function.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Kinga Tanska <kinga.tanska@linux.intel.com>
Reviewed-by: Xiao Ni <xni@redhat.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Acked-by: Coly Li <colyli@suse.de>
---
 Create.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Create.c b/Create.c
index 953e73722518..2e8203ecdccd 100644
--- a/Create.c
+++ b/Create.c
@@ -939,7 +939,7 @@ int Create(struct supertype *st, char *mddev,
 						goto abort_locked;
 					}
 					if (!fstat_is_blkdev(fd, dv->devname, &rdev))
-						return 1;
+						goto abort_locked;
 					inf->disk.major = major(rdev);
 					inf->disk.minor = minor(rdev);
 				}
-- 
2.30.2


  reply	other threads:[~2023-03-01 20:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 20:41 [PATCH mdadm v7 0/7] Write Zeroes option for Creating Arrays Logan Gunthorpe
2023-03-01 20:41 ` Logan Gunthorpe [this message]
2023-03-01 20:41 ` [PATCH mdadm v7 2/7] Create: remove safe_mode_delay local variable Logan Gunthorpe
2023-03-01 20:41 ` [PATCH mdadm v7 3/7] Create: Factor out add_disks() helpers Logan Gunthorpe
2023-03-01 20:41 ` [PATCH mdadm v7 4/7] mdadm: Introduce pr_info() Logan Gunthorpe
2023-03-03 10:35   ` Paul Menzel
2023-03-01 20:41 ` [PATCH mdadm v7 5/7] mdadm: Add --write-zeros option for Create Logan Gunthorpe
2023-03-03  8:35   ` Coly Li
2023-03-01 20:41 ` [PATCH mdadm v7 6/7] tests/00raid5-zero: Introduce test to exercise --write-zeros Logan Gunthorpe
2023-03-01 20:41 ` [PATCH mdadm v7 7/7] manpage: Add --write-zeroes option to manpage Logan Gunthorpe
     [not found] ` <CABdXBAOAJAPmKC66WNnJSL5N72JZiM=AWBxhu_Yi1ojz3jn_Jg@mail.gmail.com>
2023-03-02  2:53   ` [PATCH mdadm v7 0/7] Write Zeroes option for Creating Arrays Chaitanya Kulkarni
2023-03-02  2:55 ` Chaitanya Kulkarni
2023-03-02 16:56 ` Martin K. Petersen
2023-03-13 14:08 ` 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=20230301204135.39230-2-logang@deltatee.com \
    --to=logang@deltatee.com \
    --cc=David.Sloan@eideticom.com \
    --cc=Martin.Oliveira@eideticom.com \
    --cc=chaitanyak@nvidia.com \
    --cc=colyli@suse.de \
    --cc=guoqing.jiang@linux.dev \
    --cc=jes@trained-monkey.org \
    --cc=jm@chia.net \
    --cc=kch@nvidia.com \
    --cc=kinga.tanska@linux.intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=sbates@raithlin.com \
    --cc=xni@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 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.