Re: Version 2.1.70 ms-dos fs strange.

Richard B. Johnson (root@chaos.analogic.com)
Sat, 6 Dec 1997 23:59:23 -0500 (EST)


On Sat, 6 Dec 1997, Bill Hawes wrote:

> Richard B. Johnson wrote:
>
> > But filename.bak or FILENAME.BAK or *.BAK, etc, are not invalid names
> > under MS-DOS.
> >
> > The relatively new behavior makes scripts that contain :
> > rm -f *.bak
> > ... on a MS-DOS file-system fail because rm ignores ENOENT (only) when
> > using the (f)orce option. I can modify rm, but this is not the correct
> > fix.
>
> Well, you can make a good argument that looking up an invalid filename
> should result in ENOENT.
>
> Is this a change in behavior for msdos fs? If so, we probably should
> revert to the old behavior, unless someone has a good argument for
> returning EINVAL.
>
> Regards,
> Bill
>

Yes. Normally a function call that contains invalid parameters returns
EINVAL. For instance, if I passed a NULL instead of a character pointer to
stat, it should return EINVAL. However, if I passed in a null-string,
i.e., a valid pointer to a string containing only '\0', it should return
ENOENT. This is true when stat-ing ext2 file-systems. It should also
be true with ms-dos

The problem is not just with 'rm', 'ls' and 'bash'. It is also with 'tar'
I discovered that tar was no longer backing up MS-DOS file systems during
our automatic nightime backups. I traced the problem to its source, and
something that's easy to fix. Tar would wait forever once it received
EINVAL from readdir(). This resulted in partial backups.

Cheers,
Dick Johnson

Richard B. Johnson
Project Engineer
Analogic Corporation
Penguin : Linux version 2.1.70 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.