On Mon, 11 Feb, at 05:30:57PM, Al Viro wrote:
> On Mon, Feb 11, 2013 at 04:05:57PM +0000, Matt Fleming wrote:
> > > Egads, man...
> > > [snip the horror with copying the name]
> > > 
> > >         unsigned long hash = init_name_hash();
> > >   const unsigned char *s = qstr->name;
> > >   int len = qstr->len;
> > > 
> > >   if (!efivarfs_valid_name(s, len))
> > >           return -EINVAL;
> > >         while (len-- > GUID_LEN)
> > >           hash = partial_name_hash(*s++, hash);
> > >   /* GUID is case-insensitive. */
> > >   while (len--)
> > >           hash = partial_name_hash(tolower(*s++), hash);
> > >         return end_name_hash(hash);
> > 
> > Oh, wow, yes that is much nicer. I didn't realise we could build the
> > hash incrementally like that. Very cool.
> 
> ... except that it should end with qstr->hash = end_name_hash(hash); return 0;
> instead.  My apologies.

Oh, efivarfs also needs to stop using d_alloc_name(), which calls
full_name_hash(), because we now need to use our fs-specific hash
function.

Updated versions of both patches coming shortly.

-- 
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to