Skip to content

Commit fd71158

Browse files
committed
afs: Fix double inc of vnode->cb_break
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: be080a6 ("afs: Overhaul permit caching"); Signed-off-by: David Howells <dhowells@redhat.com>
1 parent c7226e4 commit fd71158

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎fs/afs/security.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,9 @@ void afs_clear_permits(struct afs_vnode *vnode)
8787
permits = rcu_dereference_protected(vnode->permit_cache,
8888
lockdep_is_held(&vnode->lock));
8989
RCU_INIT_POINTER(vnode->permit_cache, NULL);
90-
vnode->cb_break++;
9190
spin_unlock(&vnode->lock);
9291

93-
if (permits)
94-
afs_put_permits(permits);
92+
afs_put_permits(permits);
9593
}
9694

9795
/*

0 commit comments

Comments
 (0)