• David Howells's avatar
    afs: Fix double inc of vnode->cb_break · 2d497958
    David Howells authored
    [ Upstream commit fd711586 ]
    
    When __afs_break_callback() clears the CB_PROMISED flag, it increments
    vnode->cb_break to trigger a future refetch of the status and callback -
    however it also calls afs_clear_permits(), which also increments
    vnode->cb_break.
    
    Fix this by removing the increment from afs_clear_permits().
    
    Whilst we're at it, fix the conditional call to afs_put_permits() as the
    function checks to see if the argument is NULL, so the check is redundant.
    
    Fixes: be080a6f ("afs: Overhaul permit caching");
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    2d497958
security.c 10.2 KB