lkml.org 
[lkml]   [2002]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] ext2/3 bugfix 2/6: readdir() needs to return '.' and '..'
    From
    Date
    Add '.' and '..' entries to be returned by readdir of htree directories

    This patch from Chris Li adds '.' and '..' to the rbtree so that they
    are properly returned by readdir.

    namei.c | 9 +++++++++
    1 files changed, 9 insertions(+)

    diff -Nru a/fs/ext3/namei.c b/fs/ext3/namei.c
    --- a/fs/ext3/namei.c Wed Nov 6 17:29:46 2002
    +++ b/fs/ext3/namei.c Wed Nov 6 17:29:46 2002
    @@ -549,6 +549,15 @@
    if (!frame)
    return err;

    + /* Add '.' and '..' from the htree header */
    + if (!start_hash && !start_minor_hash) {
    + de = (struct ext3_dir_entry_2 *) frames[0].bh->b_data;
    + ext3_htree_store_dirent(dir_file, 0, 0, de);
    + de = ext3_next_entry(de);
    + ext3_htree_store_dirent(dir_file, 0, 0, de);
    + count += 2;
    + }
    +
    while (1) {
    block = dx_get_block(frame->at);
    dxtrace(printk("Reading block %d\n", block));
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 13:30    [W:3.514 / U:2.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site