Windows File Attributes
Ravi Wijayaratne
RWijayaratne at snapappliance.com
Wed Nov 12 23:10:20 GMT 2003
Hi All
Currently we are encoding the windows Hidden, Read Only, Archive and
System file attributes in
read, write, execute permissions of user, group and other id
entities. Though the above encoding
is quite cleverly done to avoid serious effects of overloading the
effective permissions we have
determined that it causes confusion when representing the ACLs.
Furthermore since Samba
now supports automatic ACL propagation, the above permissions tend
to vanish when the user,
group, mask and other ACEs are set or unset by way of propagating
permissions.
As an alternative we propose that the Windows file attributes be
stored as an extended native file
system attribute. Though the solution is fairly straightforward
there are several pitfalls that one needs
to be aware of in such an exercise.
The archive bit is set whenever the file is opened for
modifications. It will affect performance if we
have to write to the extended file attribute for each file that is
created or opened for modification. From our
Netbench benchmarks we see that there is about a 30-40% degradation
of performance if the Archive
bit is set per file creation or modification. Therefore we propose
that for files, the absence of the
extended attribute be encoded as the archive bit being set. For
directories the archive bit is not
set by default. Therefore we propose that the encoding be reversed
for directories. With this strategy
we see that there is only a 3-6% drop in performance well within the
error deviation of Netbench.
Now one may quite validly argue that we set different extended
attributes per Windows file attribute
and encode the presence and the absence of each attribute as the bit
being set or unset or vise versa.
This approach may see better performance than the above approach.
However many backup/restore
programs do not handle extended attributes. Therefore in the case of
a backup and restore operation
the Windows File System attributes are lost. Many file system
vendors go the distance to write hooks
to backup the extended attributes. Having many extended attributes
will greatly complicate their job.
I have attached a patch which is similar to our implementation. I
would very much appreciate your feed
back.
Thank you
Ravi
<<dosattr.patch>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dosattr.patch
Type: application/octet-stream
Size: 12492 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20031112/b4fc28a2/dosattr.obj
More information about the samba-technical
mailing list