• Jakob Unterwurzacher's avatar
    nodefs: lock early on FORGET · bd746dd8
    Jakob Unterwurzacher authored
    Taking the treeLock after inodeMap.Forget() exposed a
    small window where the Inode that is about to be forgotten
    could be handed out to the kernel under a new node ID.
    
    Testing with fsstress for 1.000+ iterations showed that the
    race can actually be hit, and causes "No such file or directory"
    errors.
    
    With the lock taken earlier, loopbackfs passes 10.000+ fsstress
    iterations.
    
    Change-Id: Ic02ae757d9a726ece01e8f0b3f0ff877f8e2dbc3
    bd746dd8
fsconnector.go 10.8 KB