linux/fs/afs
Wang Lei 4a2d789267 DNS: If the DNS server returns an error, allow that to be cached [ver #2]
If the DNS server returns an error, allow that to be cached in the DNS resolver
key in lieu of a value.  Userspace passes the desired error number as an option
in the payload:

	"#dnserror=<number>"

Userspace must map h_errno from the name resolution routines to an appropriate
Linux error before passing it up.  Something like the following mapping is
recommended:

	[HOST_NOT_FOUND]	= ENODATA,
	[TRY_AGAIN]		= EAGAIN,
	[NO_RECOVERY]		= ECONNREFUSED,
	[NO_DATA]		= ENODATA,

in lieu of Linux errors specifically for representing name service errors.  The
filesystem must map these errors appropropriately before passing them to
userspace.  AFS is made to map ENODATA and EAGAIN to EDESTADDRREQ for the
return to userspace; ECONNREFUSED is allowed to stand as is.

The error can be seen in /proc/keys as a negative number after the description
of the key.  Compare, for example, the following key entries:

2f97238c I--Q--     1  53s 3f010000     0     0 dns_resol afsdb:grand.centrall.org: -61
338bfbbe I--Q--     1  59m 3f010000     0     0 dns_resol afsdb:grand.central.org: 37

If the error option is supplied in the payload, the main part of the payload is
discarded.  The key should have an expiry time set by userspace.

Signed-off-by: Wang Lei <wang840925@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
2010-08-11 17:11:28 +00:00
..
Kconfig DNS: Make AFS go to the DNS for AFSDB records for unknown cells 2010-08-05 17:17:51 +00:00
Makefile FS-Cache: Make kAFS use FS-Cache 2009-04-03 16:42:41 +01:00
afs.h AFS: implement file locking 2007-07-16 09:05:43 -07:00
afs_cm.h afs: support the CB.ProbeUuid RPC op 2008-04-29 08:06:26 -07:00
afs_fs.h AFS: implement file locking 2007-07-16 09:05:43 -07:00
afs_vl.h [AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC. 2007-04-26 15:55:03 -07:00
cache.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
callback.c Fix various old email addresses for dwmw2 2008-06-06 11:29:10 -07:00
cell.c DNS: If the DNS server returns an error, allow that to be cached [ver #2] 2010-08-11 17:11:28 +00:00
cmservice.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
dir.c AFS: Don't put struct file on the stack 2010-05-21 18:31:28 -04:00
file.c AFS: Don't put struct file on the stack 2010-05-21 18:31:28 -04:00
flock.c const: make file_lock_operations const 2009-09-22 07:17:25 -07:00
fsclient.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
inode.c convert remaining ->clear_inode() to ->evict_inode() 2010-08-09 16:48:37 -04:00
internal.h convert remaining ->clear_inode() to ->evict_inode() 2010-08-09 16:48:37 -04:00
main.c AFS: Fix the module init error handling 2010-08-07 14:23:37 -07:00
misc.c AFS: Correctly translate auth error aborts and don't failover in such cases 2009-06-16 21:20:14 -07:00
mntpt.c AFS: Don't put struct file on the stack 2010-05-21 18:31:28 -04:00
netdevices.c afs: BUG to BUG_ON changes 2009-04-09 10:41:19 -07:00
proc.c seq_file: constify seq_operations 2009-09-23 07:39:29 -07:00
rxrpc.c afs: destroy work queue on init failure 2010-08-11 08:59:22 -07:00
security.c AFS: Potential null dereference 2010-03-22 09:57:19 -07:00
server.c AFS: Fix possible null pointer dereference in afs_alloc_server() 2010-06-01 09:26:36 -07:00
super.c convert remaining ->clear_inode() to ->evict_inode() 2010-08-09 16:48:37 -04:00
vlclient.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vlocation.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vnode.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
volume.c afs: add bdi backing to mount session. 2010-04-22 11:58:18 +02:00
write.c writeback: remove writeback_inodes_wbc 2010-07-06 08:54:03 +02:00