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

Re: [help needed] RAID and /dev advice needed



On Monday May 23, peter@p12n.org wrote:
> 
> tags 274859 +patch
> thanks
> 
> [martin f krafft]
> > I checked out the source and opening is not hard... but mdadm also
> > creates device nodes and uses S_ISBLK all over the place, so I don't
> > really know whether adding a "|| S_ISLNK" will fix it.
> 
> I didn't actually test this, but I honestly don't see why lstat() is
> used here, instead of stat() which is used everywhere else.
> 
> Neil?  Is there a good reason for lstat here?  It apparently breaks on
> devfs.  (Ref. http://bugs.debian.org/274859)

Maybe it what there deliberately to break devfs ??? ;-)

No, it is a bug.  It should be 'stat', not 'lstat'.

Thanks,
NeilBrown

> 
> Peter
> 
> --- mdadm-1.9.0/mdopen.c~	2005-02-03 18:45:23.000000000 -0600
> +++ mdadm-1.9.0/mdopen.c	2005-05-23 19:34:12.000000000 -0500
> @@ -97,7 +97,7 @@
>  			return -1;
>  		}
>  		stb.st_mode = 0;
> -		if (lstat(dev, &stb)==0 && ! S_ISBLK(stb.st_mode)) {
> +		if (stat(dev, &stb)==0 && ! S_ISBLK(stb.st_mode)) {
>  			fprintf(stderr, Name ": %s is not a block device.\n",
>  				dev);
>  			return -1;



Reply to: