diff mbox series

[SRU,T,6/6] cachefiles: Wait rather than BUG'ing on "Unexpected object collision"

Message ID 20180802041850.22961-7-daniel.axtens@canonical.com
State New
Headers show
Series NFS FSCache Fixes: LP: #1774336, #1776277, #1776254 | expand

Commit Message

Daniel Axtens Aug. 2, 2018, 4:18 a.m. UTC
From: Kiran Kumar Modukuri <kiran.modukuri@gmail.com>

BugLink: https://bugs.launchpad.net/bugs/1776254

If we meet a conflicting object that is marked FSCACHE_OBJECT_IS_LIVE in
the active object tree, we have been emitting a BUG after logging
information about it and the new object.

Instead, we should wait for the CACHEFILES_OBJECT_ACTIVE flag to be cleared
on the old object (or return an error).  The ACTIVE flag should be cleared
after it has been removed from the active object tree.  A timeout of 60s is
used in the wait, so we shouldn't be able to get stuck there.

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>
(cherry picked from commit c2412ac45a8f8f1cd582723c1a139608694d410d)
Signed-off-by: Daniel Axtens <daniel.axtens@canonical.com>
---
 fs/cachefiles/namei.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index beaa2fd6734f..68c2b2ae0ad6 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -199,7 +199,6 @@  wait_for_old_object:
 		printk(KERN_ERR "CacheFiles: Error:"
 		       " Unexpected object collision\n");
 		cachefiles_printk_object(object, xobject);
-		BUG();
 	}
 	atomic_inc(&xobject->usage);
 	write_unlock(&cache->active_lock);