Re: [PATCH] ext2_readdir() filp->f_pos fix

Andrew Morton
2004-07-29T22:47:35Z

Jan Blunck <j.blunck@tu-harburg.de> wrote:
>
> If the whole inode is read, ext2_readdir() sets the f_pos to a multiple

^^ directory

> of the page size (because of the conditions of the outer for loop). This
> sets the wrong f_pos for directory inodes on ext2 partitions with a
> block size differing from the page size.

Interesting. How did you actually notice this? Is the same problem not present
in 2.4?

If the IS_ERR(page) returns true, should we not advance f_pos to skip this
page?

If the filldir() call returns non-zero your patch will leave f_pos pointing at
the problematic directory entry. I'm not sure whether this is desirable.

hmm, ext2_readir() isn't propagating EFAULT back up to the caller.