Re: [RFC] readdir mess

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: OGAWA Hirofumi <hirofumi@...>, <linux-fsdevel@...>, <linux-kernel@...>
Date: Tuesday, August 12, 2008 - 2:10 pm

On Tue, Aug 12, 2008 at 10:18:49AM -0700, Linus Torvalds wrote:


Doesn't work well for readdir(2)...


you've just lost e.g. -EIO for getdents().  And if you bail out on
non-zero return value from vfs_readdir(), you are back to -EINVAL
on full buffer.

Frankly, I'd rather keep ->readdir() instances simpler.  There are far
more of those, for one thing.  As it is, we only have "stop"/"continue"
->readdir() has to care about...

There's one more thing in that mess: a bunch of vfs_readdir() callers
end up playing very sick games to make sure they get the entire
directory.  The trick is to find whether the damn thing has reached
the end; as it is, there are instances of ->readdir() that do _not_
(e.g. call filldir only once and let the caller repeat).

I'm certainly not too fond of buf->error.  If you see a better interface
I'd love to hear about it, but I don't think that "just return anything
non-zero we'd got from callback" is going to be good.  And if we go for
flagday changes in ->readdir(), we'd better get it right...
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] readdir mess, Al Viro, (Tue Aug 12, 2:22 am)
Re: [RFC] readdir mess, OGAWA Hirofumi, (Tue Aug 12, 1:02 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 1:18 pm)
Re: [RFC] readdir mess, OGAWA Hirofumi, (Tue Aug 12, 3:45 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 4:05 pm)
Re: [RFC] readdir mess, Alan Cox, (Tue Aug 12, 5:47 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 6:20 pm)
Re: [RFC] readdir mess, Alan Cox, (Tue Aug 12, 6:10 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 4:59 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 5:24 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 5:54 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 6:04 pm)
Re: [RFC] readdir mess, J. Bruce Fields, (Wed Aug 13, 12:20 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 2:10 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 4:21 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 4:38 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 5:04 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 8:04 pm)
Re: [RFC] readdir mess, Jan Harkes, (Fri Aug 15, 1:06 am)
Re: [RFC] readdir mess, Linus Torvalds, (Fri Aug 15, 12:58 pm)
Re: [RFC] readdir mess, Al Viro, (Sun Aug 24, 6:10 am)
Re: [RFC] readdir mess, Linus Torvalds, (Sun Aug 24, 1:20 pm)
Re: [RFC] readdir mess, Al Viro, (Sun Aug 24, 3:59 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Sun Aug 24, 7:51 pm)
Re: [RFC] readdir mess, Al Viro, (Sun Aug 24, 9:33 pm)
Re: [RFC] readdir mess, Al Viro, (Sun Aug 24, 9:44 pm)
Re: [RFC] readdir mess, Al Viro, (Sun Aug 24, 7:03 am)
Re: [RFC] readdir mess, J. Bruce Fields, (Mon Aug 25, 12:16 pm)
Re: [RFC] readdir mess, Al Viro, (Fri Aug 15, 1:34 am)
Re: [RFC] readdir mess, Brad Boyer, (Wed Aug 13, 4:36 am)
Re: [RFC] readdir mess, Al Viro, (Wed Aug 13, 12:19 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 8:28 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 9:19 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 9:51 pm)
Re: [RFC] readdir mess, Linus Torvalds, (Tue Aug 12, 4:02 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 2:22 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 2:37 pm)
Re: [RFC] readdir mess, Al Viro, (Tue Aug 12, 3:24 pm)