Skip to contentSkip to conversation

Posix file attribute support on VFAT

PATCH NAK Bodo Eggert 3 participants 3 messages Aug 8, 2005 – Aug 9, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · Hiroyuki Machida

For newly created and/or modified files/dirs, system can utilize full posix attributes, because memory resident inode storage can hold those. After umount-mount cycle, system may lose some attributes to preserve VFAT format.

Inodes may be reclaimed, therefore you might also lose some attributes at runtime. For your users, that will look like a heisenbug. A similar bug has been reported for procfs. Is your implementation affected?

Quoted 10 lines

- Special file
        To distinguish special files, look if this fat dir entry has ATTR_SYS, first. If it has ATTR_SYS, then check 1st. LSB bit in ctime_cs, refered as "special file flag". If set,  this file is created under VFAT with "posix_attr". Look up TYPE field to decide special file type. This spcial file detection mothod has some flaw to make potential confusion. E.g. some system file created under dos/win may be treated as special file.  However in most case, user don't create system file under dos/win.

You can add additional magic, e.g.: nodes must be empty, except for symlinks which must be not larger than 4KB (current PATH_MAX?). This will get rid of io.sys, logo.sys etc.\. If you want to be really sure, prepend a magic code to the on-disk representation of symlinks.

Signature · 2 lines
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.
#2 lore raw
Quoted 9 lines · Bodo Eggert
Quoted 4 lines · Hiroyuki Machida

For newly created and/or modified files/dirs, system can utilize full posix attributes, because memory resident inode storage can hold those. After umount-mount cycle, system may lose some attributes to preserve VFAT format.

Quoted 3 lines

Inodes may be reclaimed, therefore you might also lose some attributes at runtime. For your users, that will look like a heisenbug. A similar bug has been reported for procfs. Is your implementation affected?

Yes.
Thank you, pointed it out. So I need to select
1) restric attribute even in mamory
or
2) pinn inode in memory during mount
(I think it's not good idea)

I'll revise the patch with 1).

Quoted 12 lines
Quoted 10 lines

- Special file
To distinguish special files, look if this fat dir entry has ATTR_SYS, first. If it has ATTR_SYS, then check 1st. LSB bit in ctime_cs, refered as "special file flag". If set, this file is created under VFAT with "posix_attr". Look up TYPE field to decide special file type. This spcial file detection mothod has some flaw to make potential confusion. E.g. some system file created under dos/win may be treated as special file. However in most case, user don't create system file under dos/win.

Quoted 4 lines

You can add additional magic, e.g.: nodes must be empty, except for symlinks which must be not larger than 4KB (current PATH_MAX?). This will get rid of io.sys, logo.sys etc.\. If you want to be really sure, prepend a magic code to the on-disk representation of symlinks.

Please confirm my understanding.
You sugessted that symlink should not have ATTR_SYS, to prevent some over 4KB files created in DOS/WIN to be treated as symlinks?

Signature · 2 lines
Hiroyuki Machida		[email protected]		
SSW Dept. HENC, Sony Corp.
#3 lore raw
Quoted 5 lines · Hiroyuki

Bodo Eggert wrote:

Please confirm my understanding.
You sugessted that symlink should not have ATTR_SYS, to prevent some over 4KB files created in DOS/WIN to be treated as symlinks?

NACK, files longer than 4KB should not be symlinks, and maybe (if you're paranoid enough) files without a magic header should not be symlinks, too.

BTW: What about storing short symlinks (strlen(name)+strlen(symlink) < 200) in the filename as $name.modified_base64($symlink) and storing the split position in ctime? This would reduce the need for data blocks, which may be valuable on small devices.

Signature · 3 lines
Keep your hands off strong drink. It can make you shoot at the tax collector
and miss.
	-- R.A. Heinlein