Re: [PATCH - mdadm] mdopen: always try create_named_array()

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

 



On Wed, 22 Mar 2023, NeilBrown wrote:
> On Wed, 22 Mar 2023, Xiao Ni wrote:
> 
> > 
> > Second, are there possibilities that the arguments "dev" and "name" of
> > function create_mddev
> > are null at the same time?
> 
> No.  For Build or Create, dev is never NULL.  For Assemble and
> Incremental, name is never NULL.
> 

I should clarify this a bit.  For Assemble and Incremental, "name" is
never NULL *but* it might be an empty string.
So:
	if (name && name[0] == 0)
		name = NULL;

might cause it to become NULL.  So you cannot assume there is always
either a valid "dev" or a valid "name".  "dev" might be NULL, and "name"
might be "".

NeilBrown



[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