• Manfred Spraul's avatar
    [PATCH] `i_version' initialization fix · 9d1f716f
    Manfred Spraul authored
    Ahm.
    
    No. It must be i_version = 1
    
    Otherwise there is a trivial bug:
        mkdir("dir");
        <force the directory out of dcache>
        dir = open("dir");
        lseek(dir,1,SEEK_SET);
        readdir();
    
    lseek sets f_version to 0, and readdir() trusts f_pos, because i_version
    is 0, too. This applies to all filesystems.
    
    The ext2 patch already sets i_version to 1.
    9d1f716f
super.c 17.9 KB