afs: Don't assert on unpurgeable server records
authorDavid Howells <dhowells@redhat.com>
Thu, 15 Oct 2020 08:02:25 +0000 (09:02 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 16 Oct 2020 13:39:34 +0000 (14:39 +0100)
Don't give an assertion failure on unpurgeable afs_server records - which
kills the thread - but rather emit a trace line when we are purging a
record (which only happens during network namespace removal or rmmod) and
print a notice of the problem.

Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/server.c
include/trace/events/afs.h

index e82e452e26124e2908892eb12716657f3abb6baf..684a2b02b9ff70ae056aab6a3807f624bb26c47a 100644 (file)
@@ -550,7 +550,12 @@ void afs_manage_servers(struct work_struct *work)
 
                _debug("manage %pU %u", &server->uuid, active);
 
-               ASSERTIFCMP(purging, active, ==, 0);
+               if (purging) {
+                       trace_afs_server(server, atomic_read(&server->ref),
+                                        active, afs_server_trace_purging);
+                       if (active != 0)
+                               pr_notice("Can't purge s=%08x\n", server->debug_id);
+               }
 
                if (active == 0) {
                        time64_t expire_at = server->unuse_time;
index a79c5ca376b313174fa5f95dfc1c91d00fa0b929..8eb49231c6bb7bc75d2f63127abe86d9e1656ce7 100644 (file)
@@ -40,6 +40,7 @@ enum afs_server_trace {
        afs_server_trace_get_new_cbi,
        afs_server_trace_get_probe,
        afs_server_trace_give_up_cb,
+       afs_server_trace_purging,
        afs_server_trace_put_call,
        afs_server_trace_put_cbi,
        afs_server_trace_put_find_rsq,
@@ -311,6 +312,7 @@ enum afs_cb_break_reason {
        EM(afs_server_trace_get_new_cbi,        "GET cbi  ") \
        EM(afs_server_trace_get_probe,          "GET probe") \
        EM(afs_server_trace_give_up_cb,         "giveup-cb") \
+       EM(afs_server_trace_purging,            "PURGE    ") \
        EM(afs_server_trace_put_call,           "PUT call ") \
        EM(afs_server_trace_put_cbi,            "PUT cbi  ") \
        EM(afs_server_trace_put_find_rsq,       "PUT f-rsq") \