Revision 5ce83d4bb7d8e11e8c1c687d09f4b5ae67ef3ce3 authored by Kiran Kumar Modukuri on 21 June 2018, 20:25:53 UTC, committed by David Howells on 25 July 2018, 13:49:00 UTC
In cachefiles_mark_object_active(), the new object is marked active and then we try to add it to the active object tree. If a conflicting object is already present, we want to wait for that to go away. After the wait, we go round again and try to re-mark the object as being active - but it's already marked active from the first time we went through and a BUG is issued. Fix this by clearing the CACHEFILES_OBJECT_ACTIVE flag before we try again. Analysis from Kiran Kumar Modukuri: [Impact] Oops during heavy NFS + FSCache + Cachefiles CacheFiles: Error: Overlong wait for old active object to go away. BUG: unable to handle kernel NULL pointer dereference at 0000000000000002 CacheFiles: Error: Object already active kernel BUG at fs/cachefiles/namei.c:163! [Cause] In a heavily loaded system with big files being read and truncated, an fscache object for a cookie is being dropped and a new object being looked. The new object being looked for has to wait for the old object to go away before the new object is moved to active state. [Fix] Clear the flag 'CACHEFILES_OBJECT_ACTIVE' for the new object when retrying the object lookup. [Testcase] Have run ~100 hours of NFS stress tests and have not seen this bug recur. [Regression Potential] - Limited to fscache/cachefiles. Fixes: 9ae326a69004 ("CacheFiles: A cache that backs onto a mounted filesystem") Signed-off-by: Kiran Kumar Modukuri <kiran.modukuri@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com>
1 parent f29507c
File | Mode | Size |
---|---|---|
Makefile | -rw-r--r-- | 361 bytes |
compat.c | -rw-r--r-- | 2.2 KB |
ipc_sysctl.c | -rw-r--r-- | 5.4 KB |
mq_sysctl.c | -rw-r--r-- | 2.9 KB |
mqueue.c | -rw-r--r-- | 39.0 KB |
msg.c | -rw-r--r-- | 29.7 KB |
msgutil.c | -rw-r--r-- | 3.6 KB |
namespace.c | -rw-r--r-- | 4.8 KB |
sem.c | -rw-r--r-- | 61.2 KB |
shm.c | -rw-r--r-- | 41.6 KB |
syscall.c | -rw-r--r-- | 4.7 KB |
util.c | -rw-r--r-- | 22.6 KB |
util.h | -rw-r--r-- | 8.9 KB |
Computing file changes ...