Skip to content

Commit

Permalink
afs: Make error on cell lookup failure consistent with OpenAFS
Browse files Browse the repository at this point in the history
[ Upstream commit 2a4ca1b ]

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 <markus.suvanto@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216637
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
dhowells authored and gregkh committed Dec 3, 2023
1 parent 790ea5b commit d2b3bc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/afs/dynroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ static int afs_probe_cell_name(struct dentry *dentry)

ret = dns_query(net->net, "afsdb", name, len, "srv=1",
NULL, NULL, false);
if (ret == -ENODATA)
ret = -EDESTADDRREQ;
if (ret == -ENODATA || ret == -ENOKEY)
ret = -ENOENT;
return ret;
}

Expand Down

0 comments on commit d2b3bc8

Please sign in to comment.