Re: [PATCH mdadm v6 1/7] Create: goto abort_locked instead of return 1 in error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 23, 2022 at 12:09:48PM -0700, Logan Gunthorpe wrote:
> 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@xxxxxxxxxxxx>
> Acked-by: Kinga Tanska <kinga.tanska@xxxxxxxxxxxxxxx>

Acked-by: Coly Li <colyli@xxxxxxx>

> ---
> 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
> 

-- 
Coly Li



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux