Skip to content

Commit 80a00ab

Browse files
committed
fscache: Fix the volume collision wait condition
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 <[email protected]> Reviewed-by: Jeff Layton <[email protected]> cc: [email protected] Link: https://lore.kernel.org/r/164251398010.3435901.943876048104930939.stgit@warthog.procyon.org.uk/ # v1
1 parent 455e73a commit 80a00ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/fscache/volume.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ static void fscache_wait_on_volume_collision(struct fscache_volume *candidate,
142142
unsigned int collidee_debug_id)
143143
{
144144
wait_var_event_timeout(&candidate->flags,
145-
fscache_is_acquire_pending(candidate), 20 * HZ);
145+
!fscache_is_acquire_pending(candidate), 20 * HZ);
146146
if (!fscache_is_acquire_pending(candidate)) {
147147
pr_notice("Potential volume collision new=%08x old=%08x",
148148
candidate->debug_id, collidee_debug_id);
149149
fscache_stat(&fscache_n_volumes_collision);
150-
wait_var_event(&candidate->flags, fscache_is_acquire_pending(candidate));
150+
wait_var_event(&candidate->flags, !fscache_is_acquire_pending(candidate));
151151
}
152152
}
153153

0 commit comments

Comments
 (0)