summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-05-10 18:14:41 -0400
committerDavid Howells <dhowells@redhat.com>2019-05-16 11:25:21 -0400
commitfd711586bb7d63f257da5eff234e68c446ac35ea (patch)
tree843b8000ed1df14647a708dde3f161e1a510a37b
parentc7226e407b6065d3bda8bd9dc627663d2c505ea3 (diff)
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: be080a6f43c4 ("afs: Overhaul permit caching"); Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--fs/afs/security.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/afs/security.c b/fs/afs/security.c
index 5f58a9a17e69..db5529e47eb8 100644
--- a/fs/afs/security.c
+++ b/fs/afs/security.c
@@ -87,11 +87,9 @@ void afs_clear_permits(struct afs_vnode *vnode)
87 permits = rcu_dereference_protected(vnode->permit_cache, 87 permits = rcu_dereference_protected(vnode->permit_cache,
88 lockdep_is_held(&vnode->lock)); 88 lockdep_is_held(&vnode->lock));
89 RCU_INIT_POINTER(vnode->permit_cache, NULL); 89 RCU_INIT_POINTER(vnode->permit_cache, NULL);
90 vnode->cb_break++;
91 spin_unlock(&vnode->lock); 90 spin_unlock(&vnode->lock);
92 91
93 if (permits) 92 afs_put_permits(permits);
94 afs_put_permits(permits);
95} 93}
96 94
97/* 95/*