Skip to content

Commit 0167236

Browse files
committed
afs: Return ENOENT if no cell DNS record can be found
Make AFS return error ENOENT if no cell SRV or AFSDB DNS record (or cellservdb config file record) can be found rather than returning EDESTADDRREQ. Also add cell name lookup info to the cursor dump. Fixes: d5c32c8 ("afs: Fix cell DNS lookup") Reported-by: Markus Suvanto <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216637 Signed-off-by: David Howells <[email protected]> Reviewed-by: Marc Dionne <[email protected]> cc: [email protected]
1 parent 2a4ca1b commit 0167236

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fs/afs/vl_rotate.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ static bool afs_start_vl_iteration(struct afs_vl_cursor *vc)
5858
}
5959

6060
/* Status load is ordered after lookup counter load */
61+
if (cell->dns_status == DNS_LOOKUP_GOT_NOT_FOUND) {
62+
pr_warn("No record of cell %s\n", cell->name);
63+
vc->error = -ENOENT;
64+
return false;
65+
}
66+
6167
if (cell->dns_source == DNS_RECORD_UNAVAILABLE) {
6268
vc->error = -EDESTADDRREQ;
6369
return false;
@@ -285,6 +291,7 @@ bool afs_select_vlserver(struct afs_vl_cursor *vc)
285291
*/
286292
static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc)
287293
{
294+
struct afs_cell *cell = vc->cell;
288295
static int count;
289296
int i;
290297

@@ -294,6 +301,9 @@ static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc)
294301

295302
rcu_read_lock();
296303
pr_notice("EDESTADDR occurred\n");
304+
pr_notice("CELL: %s err=%d\n", cell->name, cell->error);
305+
pr_notice("DNS: src=%u st=%u lc=%x\n",
306+
cell->dns_source, cell->dns_status, cell->dns_lookup_count);
297307
pr_notice("VC: ut=%lx ix=%u ni=%hu fl=%hx err=%hd\n",
298308
vc->untried, vc->index, vc->nr_iterations, vc->flags, vc->error);
299309

0 commit comments

Comments
 (0)