MSDOS Filesystem question related to "read-only" files

Bob Eager rde at tavi.co.uk
Mon Nov 20 20:44:04 UTC 2017


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Mon, 20 Nov 2017 14:22:15 -0600
Karl Denninger <karl at denninger.net> wrote:

> Oh, here's another interesting anomaly -- MSDOS filesystems return "0"
> for the free file count!
> 
> (gdb) print fsbuf
> $3 = {f_version = 537068824, f_type = 50, f_flags = 4096, f_bsize =
> 4096, f_iosize = 4096, f_blocks = 1949442, f_bfree = 1949436,
> f_bavail = 1949436,
>   f_files = 0, f_ffree = 0, f_syncwrites = 3, f_asyncwrites = 5,
>   f_syncreads = 1907, f_asyncreads = 0, f_spare = 0xbf3fd628,
> f_namemax = 255,
>   f_owner = 0, f_fsid = {val = 0xbf3fd680}, f_charspare = 0xbf3fd688
> "", f_fstypename = 0xbf3fd6d8 "msdosfs",
>   f_mntfromname = 0xbf3fd6e8 "/dev/da0s1", f_mntonname = 0xbf3fd740
> "/mnt"}
> 
> Needless to say that can cause some interesting issues if you're
> coding to avoid potential inode exhaustion and the target is a MSDOS
> filesystem..... FAT filesystems DO have a maximum file count,
> incidentally.

But surely only in the root directory?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEVgdI2KeVldPAhUYaKBdf2az8e6gFAloTPP0ACgkQKBdf2az8
e6gyJwf9GlI3lnJRfO8c5VFZa4TsUTmiDIMWV+sjTsm231bBKqoJP70/m6uFXR4J
Jc8SrLHkqtmSZLEf1W2gVhZBRAg6BYU5HPigawU8ZxBUPvL5tEa8qRjjQ/WmRmb7
cBC9tER6KYRQToL7sKKmu0E0xzs0KOyFx1ZpfsVT8ssNwF7hwAlvRa3BXv11GKno
eZMpVI0AnLDyU8i8MAlEF6FkkzF2GvyxLpco+I/64VtE7f79xeJc64d4kJRNpLCR
Id+3pjwBA51izVrdeiuM0eSKc8niBZi4Y8pE+WwuXZdtX+C7ucclTZ4ceqRR/mTb
QIY3c3HGDPdhZxq+qGCD2yrV94Wo4g==
=ns6G
-----END PGP SIGNATURE-----


More information about the freebsd-fs mailing list