Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd711586 authored by David Howells's avatar David Howells
Browse files

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: be080a6f ("afs: Overhaul permit caching");
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent c7226e40
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -87,10 +87,8 @@ void afs_clear_permits(struct afs_vnode *vnode)
	permits = rcu_dereference_protected(vnode->permit_cache,
					    lockdep_is_held(&vnode->lock));
	RCU_INIT_POINTER(vnode->permit_cache, NULL);
	vnode->cb_break++;
	spin_unlock(&vnode->lock);

	if (permits)
	afs_put_permits(permits);
}