lkml.org 
[lkml]   [2019]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 08/24] erofs: add namei functions
Hi!

> > > + /*
> > > + * on-disk error, let's only BUG_ON in the debugging mode.
> > > + * otherwise, it will return 1 to just skip the invalid name
> > > + * and go on (in consideration of the lookup performance).
> > > + */
> > > + DBG_BUGON(qd->name > qd->end);
> >
> > I believe you should check for errors in non-debug mode, too.
>
> Thanks for your kindly reply!
>
> The following is just my personal thought... If I am wrong, please
> kindly point out...
>
> As you can see, this is a new prefixed string binary search algorithm
> which can provide similar performance with hashed approach (but no
> need to store hash value at all), so I really care about its lookup
> performance.
>
> There is something needing to be concerned, is, whether namei() should
> report any potential on-disk issues or just return -ENOENT for these
> corrupted dirs, I think I tend to use the latter one.

-ENOENT is okay for corrupted directories, as long as corrupted
directories do not cause some kind of security bugs (memory
corruption, crashes, ...)


Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-08-15 09:03    [W:0.061 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site