]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Fix mmap
authorDavid Howells <dhowells@redhat.com>
Tue, 14 Dec 2021 09:22:12 +0000 (09:22 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Dec 2021 17:10:13 +0000 (09:10 -0800)
commitbb8358c4b259ed7e4397bc8525b7acb49f7cdbfe
treebf839f57def63e2a6b5a9ca6d0c2e6719fdf5035
parent392e93f261befb7f3564d072ab8457ee90d81f91
afs: Fix mmap

Fix afs_add_open_map() to check that the vnode isn't already on the list
when it adds it.  It's possible that afs_drop_open_mmap() decremented
the cb_nr_mmap counter, but hadn't yet got into the locked section to
remove it.

Also vnode->cb_mmap_link should be initialised, so fix that too.

Fixes: 87dd88828bf9 ("afs: Fix mmap coherency vs 3rd-party changes")
Reported-by: kafs-testing+fedora34_64checkkafs-build-300@auristor.com
Suggested-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: kafs-testing+fedora34_64checkkafs-build-300@auristor.com
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/686465.1639435380@warthog.procyon.org.uk/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/afs/file.c
fs/afs/super.c