lkml.org 
[lkml]   [2008]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] readdir mess
On Fri, Aug 15, 2008 at 09:58:31AM -0700, Linus Torvalds wrote:

> because the "filldir()" functions should all do the right thing anyway.
> But there's certainly nothing wrong with doing it either.

Not all, but those won't hit coda.

> However, I think the real fix is something like this. This
>
> - fixes all the callers
>
> - removes more lines than it adds
>
> - simplifies and clarifies the code
>
> - avoids pointless goto's
>
> - makes error handling of vfs_readdir() consistent among the callers
> (some callers already did the error handling _correctly_ before this
> patch - this makes everybody do it the same way)

One obvious note: that'll break old_readdir() on coda. There you need to
change the existing check (you need to check buf.result, then ignore error
unless buf.result ended up 0).

I agree that such transition plan makes sense, but that'll take more
preliminary work than in your patch; there are other vfs_readdir() and
->readdir() callers, not just the obvious syscall ones.

BTW, there are several places that call specific foo_readdir() or its helper
functions, passing odd stuff as filldir (afs implements ->lookup() that way,
for one; ocfs2 checks that directory is empty; gfs2 does ->get_name() -
with filldir returning 1 on match, at that; etc.). We obviously do not care
about those in the beginning of patch series - they won't be affected,
but once we start converting foofs_readdir() to returning what filldir had
returned, we'll need to watch out for complications from those (BTW, another
fun place in that respect is __fat_readdir())


\
 
 \ /
  Last update: 2008-08-24 12:13    [W:0.423 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site