kernel_optimize_test/fs/afs
David Howells dab17c1add afs: Fix directory read/modify race
Because parsing of the directory wasn't being done under any sort of lock,
the pages holding the directory content can get invalidated whilst the
parsing is ongoing.

Further, the directory page check function gets called outside of the page
lock, so if the page gets cleared or updated, this may return reports of
bad magic numbers in the directory page.

Also, the directory may change size whilst checking and parsing are
ongoing, so more care needs to be taken here.

Fix this by:

 (1) Perform the page check from the page filling function before we set
     PageUptodate and drop the page lock.

 (2) Check for the file having shrunk and the page having been abandoned
     before checking the page contents.

 (3) Lock the page whilst parsing it for the directory iterator.

Whilst we're at it, add a tracepoint to report check failure.

Signed-off-by: David Howells <dhowells@redhat.com>
2017-11-13 15:38:20 +00:00
..
addr_list.c afs: Make use of the YFS service upgrade to fully support IPv6 2017-11-13 15:38:19 +00:00
afs_cm.h
afs_fs.h afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
afs_vl.h afs: Make use of the YFS service upgrade to fully support IPv6 2017-11-13 15:38:19 +00:00
afs.h afs: Overhaul permit caching 2017-11-13 15:38:18 +00:00
cache.c afs: Update the cache index structure 2017-11-13 15:38:17 +00:00
callback.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
cell.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
cmservice.c afs: Overhaul the callback handling 2017-11-13 15:38:18 +00:00
dir.c afs: Fix directory read/modify race 2017-11-13 15:38:20 +00:00
file.c afs: Fix directory read/modify race 2017-11-13 15:38:20 +00:00
flock.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
fsclient.c afs: Trace the initiation and completion of client calls 2017-11-13 15:38:19 +00:00
inode.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
internal.h afs: Fix directory read/modify race 2017-11-13 15:38:20 +00:00
Kconfig
main.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
Makefile afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
misc.c afs: Consolidate abort_to_error translators 2017-11-13 15:38:17 +00:00
mntpt.c afs: Add metadata xattrs 2017-07-09 14:40:12 -07:00
netdevices.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
rotate.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
rxrpc.c afs: Trace the sending of pages 2017-11-13 15:38:19 +00:00
security.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
server_list.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
server.c afs: Make use of the YFS service upgrade to fully support IPv6 2017-11-13 15:38:19 +00:00
super.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
vlclient.c afs: Trace the initiation and completion of client calls 2017-11-13 15:38:19 +00:00
volume.c afs: Make use of the YFS service upgrade to fully support IPv6 2017-11-13 15:38:19 +00:00
write.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00
xattr.c afs: Overhaul volume and server record caching and fileserver rotation 2017-11-13 15:38:19 +00:00