]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
afs: Remove erroneous seq |= 1 in volume lookup loop
authorLi RongQing <lirongqing@baidu.com>
Mon, 22 Jun 2026 09:08:42 +0000 (10:08 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 1 Jul 2026 13:26:20 +0000 (15:26 +0200)
The `seq |= 1` operation in the volume lookup loop is incorrect because:
seq is already incremented at start, making it odd in next iteration
which triggers lock, but The `|= 1` operation causes seq to be even
and unintended lockless operation

Remove this erroneous operation to maintain proper lock sequencing.

Fixes: 32222f09782f ("afs: Apply server breaks to mmap'd files in the call processor")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260622090856.2746629-9-dhowells@redhat.com
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/afs/callback.c

index 894d2bad6b6cec9ca4e70a198e967fae577e0156..833ac3178ddc75b92b7a6b743626674e8dbb051b 100644 (file)
@@ -140,7 +140,6 @@ static struct afs_volume *afs_lookup_volume_rcu(struct afs_cell *cell,
                        break;
                if (!need_seqretry(&cell->volume_lock, seq))
                        break;
-               seq |= 1; /* Want a lock next time */
        }
 
        done_seqretry(&cell->volume_lock, seq);