fscache: Fix if condition in fscache_wait_on_volume_collision()
A message that is not in the archive (sent off-list or not yet received): [email protected]
Gao Xiang
Reviewed-byQuoted 8 lines · Yue Hu
After waiting for the volume to complete the acquisition with timeout, the if condition under which potential volume collision occurs should be acquire the volume is still pending rather than not pending so that we will continue to wait until the pending flag is cleared. Also, use the existing test pending wrapper directly instead of
test_bit().Signed-off-by Yue Hu <[email protected]>---
Looks good to me,
Thanks,
Gao Xiang
Quoted 31 lines
fs/fscache/volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/fscache/volume.c +2
-2@@ -143,7 +143,7 @@ static void fscache_wait_on_volume_collision(struct fscache_volume *candidate, {wait_var_event_timeout (&candidate->flags, !fscache_is_acquire_pending (candidate),20 *HZ ); -if (!fscache_is_acquire_pending (candidate)) { +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);@@ -182,7 +182,7 @@ static bool fscache_hash_volume(struct fscache_volume *candidate)hlist_bl_add_head (&candidate->hash_link, h);hlist_bl_unlock (h); -if (test_bit (FSCACHE_VOLUME_ACQUIRE_PENDING , &candidate->flags)) +if (fscache_is_acquire_pending (candidate))fscache_wait_on_volume_collision (candidate, collidee_debug_id);return true;Signature · 5 lines
2.17.1 -- Linux-cachefs mailing list [email protected] https://listman.redhat.com/mailman/listinfo/linux-cachefs
JeffleXu
Reviewed-byQuoted 16 lines · Yue Hu
After waiting for the volume to complete the acquisition with timeout, the if condition under which potential volume collision occurs should be acquire the volume is still pending rather than not pending so that we will continue to wait until the pending flag is cleared. Also, use the existing test pending wrapper directly instead of
test_bit().Signed-off-by Yue Hu <[email protected]>--- fs/fscache/volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/fscache/volume.c +0
-0
fs/fscache/volume.c static void fscache_wait_on_volume_collision(struct fscache_volume *candidate, · line 149
Quoted 8 lines
fs/fscache/volume.c +1
-1@@ -143,7 +143,7 @@ static void fscache_wait_on_volume_collision(struct fscache_volume *candidate, {wait_var_event_timeout (&candidate->flags, !fscache_is_acquire_pending (candidate),20 *HZ ); -if (!fscache_is_acquire_pending (candidate)) { +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);
Yeah, I also noticed that before.
fs/fscache/volume.c static bool fscache_hash_volume(struct fscache_volume *candidate) · line 188
Quoted 9 lines
fs/fscache/volume.c +1
-1@@ -182,7 +182,7 @@ static bool fscache_hash_volume(struct fscache_volume *candidate)hlist_bl_add_head (&candidate->hash_link, h);hlist_bl_unlock (h); -if (test_bit (FSCACHE_VOLUME_ACQUIRE_PENDING , &candidate->flags)) +if (fscache_is_acquire_pending (candidate))fscache_wait_on_volume_collision (candidate, collidee_debug_id);return true;
LGTM.
Signature · 2 lines
Thanks, Jeffle
Jeff Layton
Reviewed-byQuoted 25 lines · Yue Hu
After waiting for the volume to complete the acquisition with timeout, the if condition under which potential volume collision occurs should be acquire the volume is still pending rather than not pending so that we will continue to wait until the pending flag is cleared. Also, use the existing test pending wrapper directly instead of
test_bit().Signed-off-by Yue Hu <[email protected]>--- fs/fscache/volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/fscache/volume.c +1
-1@@ -143,7 +143,7 @@ static void fscache_wait_on_volume_collision(struct fscache_volume *candidate, {wait_var_event_timeout (&candidate->flags, !fscache_is_acquire_pending (candidate),20 *HZ ); -if (!fscache_is_acquire_pending (candidate)) { +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);
fs/fscache/volume.c static bool fscache_hash_volume(struct fscache_volume *candidate) · line 188
Quoted 8 lines
fs/fscache/volume.c +1
-1@@ -182,7 +182,7 @@ static bool fscache_hash_volume(struct fscache_volume *candidate)hlist_bl_add_head (&candidate->hash_link, h);hlist_bl_unlock (h); -if (test_bit (FSCACHE_VOLUME_ACQUIRE_PENDING , &candidate->flags)) +if (fscache_is_acquire_pending (candidate))fscache_wait_on_volume_collision (candidate, collidee_debug_id);return true;
Nice catch: