• Jeff Moyer's avatar
    autofs4: fix incorrect return from root.c:try_to_fill_dentry() · 9d2de6ad
    Jeff Moyer authored
    Jeff Moyer has identified a case where the autofs4 function
    root.c:try_to_fill_dentry() can return -EBUSY when it should return 0.
    
    Jeff's description of the way this happens is:
    
    "automount starts an expire for directory d.  after the callout to the daemon,
    but before the rmdir, another process tries to walk into the same directory.
    It puts itself onto the waitq, pending the expiration.
    
    When the expire finishes, the second process is woken up.  In
    try_to_fill_dentry, it does this check:
    
                    status = d_invalidate(dentry);
                    if (status != -EBUSY)
                            return -EAGAIN;
    
    And status is EBUSY.  The dentry still has a non-zero d_inode, and the
    flags do not contain LOOKUP_CONTINUE or LOOKUP_DIRECTORY
    
    So, we fall through and return -EBUSY to the caller."
    Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
    Signed-off-by: default avatarIan Kent <raven@themaw.net>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    9d2de6ad
root.c 27.1 KB