• Martin Brandenburg's avatar
    orangefs: set i_size on new symlink · f6a4b4c9
    Martin Brandenburg authored
    As long as a symlink inode remains in-core, the destination (and
    therefore size) will not be re-fetched from the server, as it cannot
    change.  The original implementation of the attribute cache assumed that
    setting the expiry time in the past was sufficient to cause a re-fetch
    of all attributes on the next getattr.  That does not work in this case.
    
    The bug manifested itself as follows.  When the command sequence
    
    touch foo; ln -s foo bar; ls -l bar
    
    is run, the output was
    
    lrwxrwxrwx. 1 fedora fedora 4906 Apr 24 19:10 bar -> foo
    
    However, after a re-mount, ls -l bar produces
    
    lrwxrwxrwx. 1 fedora fedora    3 Apr 24 19:10 bar -> foo
    
    After this commit, even before a re-mount, the output is
    
    lrwxrwxrwx. 1 fedora fedora    3 Apr 24 19:10 bar -> foo
    Reported-by: default avatarBecky Ligon <ligon@clemson.edu>
    Signed-off-by: default avatarMartin Brandenburg <martin@omnibond.com>
    Fixes: 71680c18 ("orangefs: Cache getattr results.")
    Cc: stable@vger.kernel.org
    Cc: hubcap@omnibond.com
    Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
    f6a4b4c9
namei.c 12.9 KB