linux/fs
Andy Adamson ec6b5d7b50 nfsd41: create_session operation
Implement the create_session operation confoming to
http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26

Look up the client id (generated by the server on exchange_id,
given by the client on create_session).
If neither a confirmed or unconfirmed client is found
then the client id is stale
If a confirmed cilent is found (i.e. we already received
create_session for it) then compare the sequence id
to determine if it's a replay or possibly a mis-ordered rpc.
If the seqid is in order, update the confirmed client seqid
and procedd with updating the session parameters.

If an unconfirmed client_id is found then verify the creds
and seqid.  If both match move the client id to confirmed state
and proceed with processing the create_session.

Currently, we do not support persistent sessions, and RDMA.

alloc_init_session generates a new sessionid and creates
a session structure.

NFSD_PAGES_PER_SLOT is used for the max response cached calculation, and for
the counting of DRC pages using the hard limits set in struct srv_serv.

A note on NFSD_PAGES_PER_SLOT:

Other patches in this series allow for NFSD_PAGES_PER_SLOT + 1 pages to be
cached in a DRC slot when the response size is less than NFSD_PAGES_PER_SLOT *
PAGE_SIZE but xdr_buf pages are used. e.g. a READDIR operation will encode a
small amount of data in the xdr_buf head, and then the READDIR in the xdr_buf
pages.  So, the hard limit calculation use of pages by a session is
underestimated by the number of cached operations using the xdr_buf pages.

Yet another patch caches no pages for the solo sequence operation, or any
compound where cache_this is False.  So the hard limit calculation use of
pages by a session is overestimated by the number of these operations in the
cache.

TODO: improve resource pre-allocation and negotiate session
parameters accordingly.  Respect and possibly adjust
backchannel attributes.

Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: Dean Hildebrand <dhildeb@us.ibm.com>
[nfsd41: remove headerpadsz from channel attributes]
Our client and server only support a headerpadsz of 0.
[nfsd41: use DRC limits in fore channel init]
[nfsd41: do not change CREATE_SESSION back channel attrs]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[use sessionid_lock spin lock]
[nfsd41: use bool inuse for slot state]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfsd41 remove sl_session from alloc_init_session]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[simplify nfsd4_encode_create_session error handling]
[nfsd41: fix comment style in init_forechannel_attrs]
[nfsd41: allocate struct nfsd4_session and slot table in one piece]
[nfsd41: no need to INIT_LIST_HEAD in alloc_init_session just prior to list_add]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2009-04-03 17:41:18 -07:00
..
9p
adfs
affs
afs
autofs
autofs4
befs
bfs
btrfs Btrfs: fix spinlock assertions on UP systems 2009-03-09 11:45:38 -04:00
cifs
coda
configfs
cramfs
debugfs
devpts devpts: remove graffiti 2009-03-10 15:55:11 -07:00
dlm
ecryptfs eCryptfs: don't encrypt file key with filename key 2009-03-14 11:57:22 -07:00
efs
exportfs
ext2
ext3
ext4 ext4: fix bb_prealloc_list corruption due to wrong group locking 2009-03-16 23:25:40 -04:00
fat Fix _fat_bmap() locking 2009-03-11 12:04:18 -07:00
freevxfs
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd lockd: clean up blocking lock cases of nlsmvc_lock() 2009-03-18 17:30:50 -04:00
minix
ncpfs
nfs NFS: Fix the fix to Bugzilla #11061, when IPv6 isn't defined... 2009-03-12 14:51:32 -04:00
nfs_common
nfsd nfsd41: create_session operation 2009-04-03 17:41:18 -07:00
nls
notify
ntfs
ocfs2 ocfs2: Use xs->bucket to set xattr value outside 2009-03-12 16:46:09 -07:00
omfs
openpromfs
partitions
proc Avoid 64-bit "switch()" statements on 32-bit architectures 2009-03-17 10:02:35 -07:00
qnx4
ramfs nommu: ramfs: don't leak pages when adding to page cache fails 2009-03-14 11:57:22 -07:00
reiserfs
romfs
smbfs
squashfs Squashfs: Valid filesystems are flagged as bad by the corrupted fs patch 2009-03-12 03:23:48 +00:00
sysfs
sysv
ubifs
udf
ufs
xfs xfs: only issues a cache flush on unmount if barriers are enabled 2009-03-06 17:35:12 -06:00
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c block: Add gfp_mask parameter to bio_integrity_clone() 2009-03-14 21:06:51 +01:00
bio.c block: fix memory leak in bio_clone() 2009-03-14 21:06:52 +01:00
block_dev.c
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c Fix FREEZE/THAW compat_ioctl regression 2009-02-27 16:27:45 -08:00
dcache.c EXPORT_SYMBOL(d_obtain_alias) rather than EXPORT_SYMBOL_GPL 2009-02-27 16:26:20 -08:00
dcookies.c
direct-io.c
dquot.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file.c
file_table.c
filesystems.c
fs-writeback.c fs: new inode i_state corruption fix 2009-03-12 16:20:24 -07:00
generic_acl.c
inode.c fs: new inode i_state corruption fix 2009-03-12 16:20:24 -07:00
internal.h
ioctl.c
ioprio.c
Kconfig
Kconfig.binfmt
libfs.c
locks.c
Makefile ext4: Reorder fs/Makefile so that ext2 root fs's are mounted using ext2 2009-02-28 09:50:01 -05:00
mbcache.c
mpage.c
namei.c
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c pipe_rdwr_fasync: fix the error handling to prevent the leak/crash 2009-03-12 16:20:23 -07:00
pnode.c
pnode.h
posix_acl.c
quota.c
quota_tree.c
quota_tree.h
quota_v1.c
quota_v2.c
quotaio_v1.h
quotaio_v2.h
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
super.c vfs: add missing unlock in sget() 2009-03-12 16:20:23 -07:00
sync.c
timerfd.c
utimes.c
xattr.c
xattr_acl.c