Re: [PATCH 15/19] mkfs: don't treat files as though they are block devices

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

 




On 4/8/16 9:58 AM, Jan Tulak wrote:
>     This one causes at least one interesting issue:
> 
>     #mkfs/mkfs.xfs
>     Error accessing specified device (null): Bad address
>     Usage: mkfs.xfs
>     ...
> 
>     because:
> 
>             check_device_type(dfile, &xi.disfile, !dsize, !dfile,
>                               Nflag ? NULL : &xi.dcreat, force_overwrite, "d");
> 
>     so "dfile" can be NULL, but that function immediately tries to stat it.
> 
> 
> ​A simple if NULL, then usage() should take care of this...

Well, think hard about that.  If dfile == NULL and bails with usage(), then
what is the point of having !dfile as a function argument?

Validation of having a target specified as either -dfile= or as the last argument
should probably happen before the call to check_device_type.

-Eric

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux