Re: problems with readdir in isofs in recent kernels

From: Oliver Mueschke (o@mueschke.de)
Date: Mon May 01 2000 - 15:07:04 EST


On Mon, May 01, 2000 at 05:25:47PM +0200, Robert Schiele wrote:
> I have experienced problems with readdir in isofs in recent kernels. I found
> that sometimes on large directories not all entries appear - no read errors
> do occur.

this is obviously wrong since 2.1.xx upto 2.3.99

see linux/fs/isofs/dir.c (comments by me):

static int do_isofs_readdir(struct inode *inode, struct file *filp, ....)
{
    ...
    while (filp->f_pos < inode->i_size) {
        ...
        /* this is invalid when offset == bufsize !! */
        de = (struct iso_directory_record *) (bh->b_data + offset);
        ...
        /* de is not within the buffer when offset == bufsize */
        de_len = *(unsigned char *) de;
        ...
        /* so de_len is not the length of a dir entry, but maybe de_len == 0 */
        if ((de_len == 0) || (offset >= bufsize) ) {
            brelse(bh);
            /* looks like the end of dir entries */
            if (de_len == 0) {
                ...
            }
            /* here it is too late to handle offset == bufsize,
               the wrong conclusion is allready drawn.*/
            ...
        }
        offset += de_len;
        /* offset == bufsize needs be handled later, but *before* offset is used */
        if (offset > bufsize) {
            ...
        }
        ...
    }
}

this was posted at least 2 or 3 times now (first in aug 99) along with a patch.
nobody seems to care. it's discouraging.

oliver

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:09 EST