• Andrew Morton's avatar
    [PATCH] bfs filesystem read past the end of dir · e37a41af
    Andrew Morton authored
    From: Jakub Jermar <jermar@itbs.cz>
    
    I found out that BFS filesystem will eventually try to read and interpret
    garbage past the end of directory in bfs_add_entry().  If the garbage
    (interpreted as i-node number) is not set to zero (does it have to be?)
    bfs_add_entry() will consider it a regular directory entry. 
    
    This causes weird things like this:
    # touch a
    # rm a
    # ls
    # touch b
    # ls
    a
    
    My patch detects an attempt to read past the end of directory and explicitly
    clears the garbage that represents i-node number.  Thus the correct behaviour
    is achieved.
    
    (was unable to contact Tigran)
    e37a41af
dir.c 8.32 KB