Skip to content

Commit 2a4ca1b

Browse files
committed
afs: Make error on cell lookup failure consistent with OpenAFS
When kafs tries to look up a cell in the DNS or the local config, it will translate a lookup failure into EDESTADDRREQ whereas OpenAFS translates it into ENOENT. Applications such as West expect the latter behaviour and fail if they see the former. This can be seen by trying to mount an unknown cell: # mount -t afs %example.com:cell.root /mnt mount: /mnt: mount(2) system call failed: Destination address required. Fixes: 4d673da ("afs: Support the AFS dynamic root") 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: Jeffrey Altman <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected]
1 parent e6bace7 commit 2a4ca1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/afs/dynroot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ static int afs_probe_cell_name(struct dentry *dentry)
132132

133133
ret = dns_query(net->net, "afsdb", name, len, "srv=1",
134134
NULL, NULL, false);
135-
if (ret == -ENODATA)
136-
ret = -EDESTADDRREQ;
135+
if (ret == -ENODATA || ret == -ENOKEY)
136+
ret = -ENOENT;
137137
return ret;
138138
}
139139

0 commit comments

Comments
 (0)