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

Re: Extended Attributes and Access Control Lists

On Oct 29, 2001  05:15 +0100, Andreas Gruenbacher wrote:
> On Sun, 28 Oct 2001, Andreas Dilger wrote:
> > Hmm, I had a good look around, and couldn't find it.  Finally, I see
> > that it is already part of the "current" patches.
> > 
> >   http://acl.bestbits.at/current/linux-2.4.13ea-0.7.22.patch.gz
> >   http://acl.bestbits.at/current/linux-2.4.13-ac3-ea-0.7.22.patch.gz
> >   http://acl.bestbits.at/current/linux-2.4.13-ac4-ea-0.7.22.patch.gz
> > 
> > - It seems that there are not enough files modified in the ext3 tree
> >   to implement EAs properly (at least compared to the number of files
> >   changed in the ext2 tree.  Is part of the patch missing?
> I don't think so. It's seven files modified in ext2 as well as in
> ext3. Which patches are you comparing?

The Linus-kernel file (first one listed above).  It only includes the
patch for the new file ext3/ext_attr.c.

> > - In ext3_ext_attr_cmp() shouldn't it be enough to compare only the
> >   hash values of each entry (or even better - only the hash value in
> >   the header)?  Maybe the entry hash should include the name as well?
> >   I don't think you will ever want to merge EAs with identical data
> >   but different names.  It seems like we are comparing too many things.
> The hash values in the header only differ if a hash collision occurs,
> which hopefully is a very rare event. Therefore I'm not doing this check
> at all, and directly go to the more detailed checks.

I'm not sure I follow you.  I haven't looked at the code closesly, but I
would think that the hash value in the EA block header was some product*
of the hash values of each of the individual entries.  This allows you
to compare two blocks for sharing simply by comparing the two header
hash values.  If they are identical, only then do you need to compare each
entry hash value separately.  The chances of collisions in both the
header hash and all of the entry hashes is vanishingly small if there
is more than a single EA in the block.

(*) the header hash could be some product of the entry hashes + each
    entry name.  This would ensure that a header hash collision with
    two blocks each with only one entry would not also be a collision
    at the entry level.

> Comparing the hash values of entries alone isn't enough because of
> collisons, though. Each entry hash does include the name and value.

> Entries are always kept in a cardinal order in disk, so this problem
> actually doesn't occur.

OK, that works as well.

Cheers, Andreas
Andreas Dilger

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