Skip to content

Commit

Permalink
fscache: Fix the volume collision wait condition
Browse files Browse the repository at this point in the history
The condition that the waits in fscache_wait_on_volume_collision() are
waiting until are inverted.  This suddenly started happening on the
upstream kernel with something like the following appearing in dmesg when
running xfstests:

	CacheFiles: cachefiles: Inode already in use: Iafs,example.com,100055

Fix them by inverting the conditions.

Fixes: 62ab633 ("fscache: Implement volume registration")
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/164251398010.3435901.943876048104930939.stgit@warthog.procyon.org.uk/ # v1
  • Loading branch information
David Howells committed Jan 21, 2022
1 parent 455e73a commit 80a00ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/fscache/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ static void fscache_wait_on_volume_collision(struct fscache_volume *candidate,
unsigned int collidee_debug_id)
{
wait_var_event_timeout(&candidate->flags,
fscache_is_acquire_pending(candidate), 20 * HZ);
!fscache_is_acquire_pending(candidate), 20 * HZ);
if (!fscache_is_acquire_pending(candidate)) {
pr_notice("Potential volume collision new=%08x old=%08x",
candidate->debug_id, collidee_debug_id);
fscache_stat(&fscache_n_volumes_collision);
wait_var_event(&candidate->flags, fscache_is_acquire_pending(candidate));
wait_var_event(&candidate->flags, !fscache_is_acquire_pending(candidate));
}
}

Expand Down

0 comments on commit 80a00ab

Please sign in to comment.