Re: [RFC] readdir mess

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: OGAWA Hirofumi <hirofumi@...>
Cc: Al Viro <viro@...>, <linux-fsdevel@...>, <linux-kernel@...>
Date: Tuesday, August 12, 2008 - 1:18 pm

On Wed, 13 Aug 2008, OGAWA Hirofumi wrote:

I think it just makes things more confused.

If we actually want to change the readdir() thing, then we should just 
make the rule be:

 - if the callback returns a non-zero value, the filesystem "readdir()" 
   function should return that value (right now they are taught to return 
   zero, and return errors on internal fatal things). And get rid of 
   "buf.error" entirely.

   The reason for the whole "buf.error" etc stuff is simply because that 
   avoided having the low-level filesystem even care about things. But if 
   you really want to clean this up, we should *NOT* continue the current 

 - the callers should then do

	error = vfs_readdir(file, filldir, &buf);
	lastdirent = buf.previous;
	if (lastdirent) {
		error = count - buf.count;
		if (put_user(file->f_pos, &lastdirent->d_off))
			error = -EFAULT;
	}
	fput(file);
	return error;

   and we wouldn't need any other logic at all.

As to -EOVERFLOW, I suspect we are better off just dropping that whole 
logic. Returning -EOVERFLOW and truncating the readdir listing is likely 
much worse than the alternative. It made sense back when we needed to get 
people to upgrade the system interfaces, now it just means that old 
binaries won't work at all.

		Linus
--
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)