summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
Commit message (Collapse)AuthorAgeFilesLines
* SUNRPC: RPC buffer size estimates are too largeChuck Lever2007-04-301-5/+2
| | | | | | | | | | | | | | | | | | | The RPC buffer size estimation logic in net/sunrpc/clnt.c always significantly overestimates the requirements for the buffer size. A little instrumentation demonstrated that in fact rpc_malloc was never allocating the buffer from the mempool, but almost always called kmalloc. To compute the size of the RPC buffer more precisely, split p_bufsiz into two fields; one for the argument size, and one for the result size. Then, compute the sum of the exact call and reply header sizes, and split the RPC buffer precisely between the two. That should keep almost all RPC buffers within the 2KiB buffer mempool limit. And, we can finally be rid of RPC_SLACK_SPACE! Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Fix NFS4_enc_server_caps_sz/NFS4_dec_server_caps_szTrond Myklebust2007-02-031-0/+2
| | | | | | Insert missing encode_putfh_maxsz/decode_putfh_maxsz Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* [PATCH] xdr annotations: NFS readdir entriesAl Viro2006-10-201-1/+1
| | | | | | | | | | | | on-the-wire data is big-endian [in large part pulled from Alexey's patch] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] xdr annotations: NFSv4Al Viro2006-10-201-177/+181
| | | | | | | | | | | | on-the-wire data is big-endian [in large part pulled from Alexey's patch] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* NFS: Use cached page as buffer for NFS symlink requestsChuck Lever2006-09-221-4/+4
| | | | | | | | | | | Now that we have a copy of the symlink path in the page cache, we can pass a struct page down to the XDR routines instead of a string buffer. Test plan: Connectathon, all NFS versions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Rename nfs_server::nfs4_stateDavid Howells2006-09-221-5/+5
| | | | | | | | Rename nfs_server::nfs4_state to nfs_client as it will be used to represent the client state for NFS2 and NFS3 also. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Rename struct nfs4_client to struct nfs_clientDavid Howells2006-09-221-9/+9
| | | | | | | | Rename struct nfs4_client to struct nfs_client so that it can become the basis for a general client record for NFS2 and NFS3 in addition to NFS4. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Disambiguate nfs_stat_to_errno()David Howells2006-09-221-7/+7
| | | | | | | | Rename the NFS4 version of nfs_stat_to_errno() so that it doesn't conflict with the common one used by NFS2 and NFS3. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Check lengths more thoroughly in NFS4 readdir XDR decodeDavid Howells2006-08-241-10/+11
| | | | | | | | | | | | | | | | | | | Check the bounds of length specifiers more thoroughly in the XDR decoding of NFS4 readdir reply data. Currently, if the server returns a bitmap or attr length that causes the current decode point pointer to wrap, this could go undetected (consider a small "negative" length on a 32-bit machine). Also add a check into the main XDR decode handler to make sure that the amount of data is a multiple of four bytes (as specified by RFC-1014). This makes sure that we can do u32* pointer subtraction in the NFS client without risking an undefined result (the result is undefined if the pointers are not correctly aligned with respect to one another). Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> (cherry picked from 5861fddd64a7eaf7e8b1a9997455a24e7f688092 commit)
* NFSv4: A root pathname is sent as a zero component4Andy Adamson2006-06-091-1/+10
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Define an fs_locations bitmapManoj Naik2006-06-091-2/+9
| | | | | | | | | | | This is (similar to getattr bitmap) but includes fs_locations and mounted_on_fileid attributes. Use this bitmap for encoding in fs_locations requests. Note: We can probably do better by requesting locations as part of fsinfo itself. Signed-off-by: Manoj Naik <manoj@almaden.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Decode mounted_on_fileid attribute in getattr.Manoj Naik2006-06-091-0/+21
| | | | | | | | It is ignored if fileid is also requested. This will be used on referrals (fs_locations). Signed-off-by: Manoj Naik <manoj@almaden.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: convert fs-locations-components to conform to RFC3530Manoj Naik2006-06-091-9/+71
| | | | | | | | Use component4-style formats for decoding list of servers and pathnames in fs_locations. Signed-off-by: Manoj Naik <manoj@almaden.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Implement the fs_locations function callTrond Myklebust2006-06-091-2/+110
| | | | | | | | | | | NFSv4 allows for the fact that filesystems may be replicated across several servers or that they may be migrated to a backup server in case of failure of the primary server. fs_locations is an NFSv4 operation for retrieving information about the location of migrated and/or replicated filesystems. Based on an initial implementation by Jiaying Zhang <jiayingz@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Store the file system "fsid" value in the NFS super block.Trond Myklebust2006-06-091-2/+2
| | | | | | | This should enable us to detect if we are crossing a mountpoint in the case where the server is exporting "nohide" mounts. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: remove obviously bogus comparison from decode_getaclJ. Bruce Fields2006-06-091-2/+1
| | | | | | | | | | We just set *acl_len to zero, and attrlen is unsigned, so this comparison is clearly bogus. I have no idea what I was thinking. Fixes a bug that caused getacl to fail over krb5p. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* Merge git://git.linux-nfs.org/pub/linux/nfs-2.6Linus Torvalds2006-03-251-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.linux-nfs.org/pub/linux/nfs-2.6: (103 commits) SUNRPC,RPCSEC_GSS: spkm3--fix config dependencies SUNRPC,RPCSEC_GSS: spkm3: import contexts using NID_cast5_cbc LOCKD: Make nlmsvc_traverse_shares return void LOCKD: nlmsvc_traverse_blocks return is unused SUNRPC,RPCSEC_GSS: fix krb5 sequence numbers. NFSv4: Dont list system.nfs4_acl for filesystems that don't support it. SUNRPC,RPCSEC_GSS: remove unnecessary kmalloc of a checksum SUNRPC: Ensure rpc_call_async() always calls tk_ops->rpc_release() SUNRPC: Fix memory barriers for req->rq_received NFS: Fix a race in nfs_sync_inode() NFS: Clean up nfs_flush_list() NFS: Fix a race with PG_private and nfs_release_page() NFSv4: Ensure the callback daemon flushes signals SUNRPC: Fix a 'Busy inodes' error in rpc_pipefs NFS, NLM: Allow blocking locks to respect signals NFS: Make nfs_fhget() return appropriate error values NFSv4: Fix an oops in nfs4_fill_super lockd: blocks should hold a reference to the nlm_file NFSv4: SETCLIENTID_CONFIRM should handle NFS4ERR_DELAY/NFS4ERR_RESOURCE NFSv4: Send the delegation stateid for SETATTR calls ...
| * SUNRPC: display human-readable procedure name in rpc_iostats outputChuck Lever2006-03-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add fields to the rpc_procinfo struct that allow the display of a human-readable name for each procedure in the rpc_iostats output. Also fix it so that the NFSv4 stats are broken up correctly by sub-procedure number. NFSv4 uses only two real RPC procedures: NULL, and COMPOUND. Test plan: Mount with NFSv2, NFSv3, and NFSv4, and do "cat /proc/self/mountstats". Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | [PATCH] fs: Use ARRAY_SIZE macroTobias Klauser2006-03-241-1/+1
|/ | | | | | | | | | | | | | | | | Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a duplicate of ARRAY_SIZE. Some trailing whitespaces are also deleted. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Cc: David Howells <dhowells@redhat.com> Cc: Dave Kleikamp <shaggy@austin.ibm.com> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Neil Brown <neilb@cse.unsw.edu.au> Cc: Chris Mason <mason@suse.com> Cc: Jeff Mahoney <jeffm@suse.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Nathan Scott <nathans@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* NFS: Send valid mode bits to the serverTrond Myklebust2006-01-061-1/+1
| | | | | | | inode->i_mode contains a lot more than just the mode bits. Make sure that we mask away this extra stuff in SETATTR calls to the server. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Ensure DELEGRETURN returns attributesTrond Myklebust2006-01-061-11/+22
| | | | | | | | Upon return of a write delegation, the server will almost always bump the change attribute. Ensure that we pick up that change so that we don't invalidate our data cache unnecessarily. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Convert LOCK rpc call into an asynchronous RPC callTrond Myklebust2006-01-061-6/+0
| | | | | | In order to allow users to interrupt/cancel it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: locking XDR cleanupTrond Myklebust2006-01-061-56/+75
| | | | | | Get rid of some unnecessary intermediate structures Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Make open recovery track O_RDWR, O_RDONLY and O_WRONLY correctlyTrond Myklebust2006-01-061-4/+7
| | | | | | | When recovering from a delegation recall or a network partition, we need to replay open(O_RDWR), open(O_RDONLY) and open(O_WRONLY) separately. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Make open_confirm() asynchronous tooTrond Myklebust2006-01-061-5/+2
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Convert open() into an asynchronous RPC callTrond Myklebust2006-01-061-3/+0
| | | | | | | | | OPEN is a stateful operation, so we must ensure that it always completes. In order to allow users to interrupt the operation, we need to make the RPC call asynchronous, and then wait on completion (or cancel). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Convert unnecessary XDR warning messages into dprintk()Trond Myklebust2005-10-271-11/+6
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Add post-op attributes to NFSv4 write and commit callbacks.Trond Myklebust2005-10-271-6/+22
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Add post-op attributes to nfs4_proc_remove()Trond Myklebust2005-10-271-8/+17
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Add post-op attributes to nfs4_proc_rename()Trond Myklebust2005-10-271-5/+24
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Add post-op attributes to nfs4_proc_link()Trond Myklebust2005-10-271-6/+28
| | | | | | | Optimise attribute revalidation when hardlinking. Add post-op attributes for the directory and the original inode. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Add optional post-op getattr instruction to the NFSv4 file close.Trond Myklebust2005-10-271-6/+28
| | | | | | | | "Optional" means that the close call will not fail if the getattr at the end of the compound fails. If it does succeed, try to refresh inode attributes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Add directory post-op attributes to the CREATE operations.Trond Myklebust2005-10-271-10/+59
| | | | | | | | Since the directory attributes change every time we CREATE a file, we might as well pick up the new directory attributes in the same compound. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Optimise inode attribute cache updatesTrond Myklebust2005-10-271-3/+1
| | | | | | | Allow nfs_refresh_inode() also to update attributes on the inode if the RPC call was sent after the last call to nfs_update_inode(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: handle no acl attrJ. Bruce Fields2005-10-181-1/+2
| | | | | | | | | Stop handing garbage to userspace in the case where a weird server clears the acl bit in the getattr return (despite the fact that they've already claimed acl support.) Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Fix up handling of open_to_lock sequence idsTrond Myklebust2005-10-181-19/+13
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Make NFS clean up byte range locks asynchronouslyTrond Myklebust2005-10-181-6/+3
| | | | | | Currently we fail to do so if the process was signalled. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Fix a potential CLOSE raceTrond Myklebust2005-10-181-10/+4
| | | | | | | | | | Once the state_owner and lock_owner semaphores get removed, it will be possible for other OPEN requests to reopen the same file if they have lower sequence ids than our CLOSE call. This patch ensures that we recheck the file state once nfs_wait_on_sequence() has completed waiting. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Add functions to order RPC callsTrond Myklebust2005-10-181-8/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NFSv4 file state-changing functions such as OPEN, CLOSE, LOCK,... are all labelled with "sequence identifiers" in order to prevent the server from reordering RPC requests, as this could cause its file state to become out of sync with the client. Currently the NFS client code enforces this ordering locally using semaphores to restrict access to structures until the RPC call is done. This, of course, only works with synchronous RPC calls, since the user process must first grab the semaphore. By dropping semaphores, and instead teaching the RPC engine to hold the RPC calls until they are ready to be sent, we can extend this process to work nicely with asynchronous RPC calls too. This patch adds a new list called "rpc_sequence" that defines the order of the RPC calls to be sent. We add one such list for each state_owner. When an RPC call is ready to be sent, it checks if it is top of the rpc_sequence list. If so, it proceeds. If not, it goes back to sleep, and loops until it hits top of the list. Once the RPC call has completed, it can then bump the sequence id counter, and remove itself from the rpc_sequence list, and then wake up the next sleeper. Note that the state_owner sequence ids and lock_owner sequence ids are all indexed to the same rpc_sequence list, so OPEN, LOCK,... requests are all ordered w.r.t. each other. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* [PATCH] NFS: Add debugging code to NFSv4 readdirTrond Myklebust2005-06-221-0/+18
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* [PATCH] NFSv4: Map a couple of NFSv4 errors to EINVAL.Manoj Naik2005-06-221-0/+2
| | | | | | | This shows up on running tar over NFSv4. Signed-off-by: Manoj Naik <manoj@almaden.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* [PATCH] NFSv4: add support for rdattr_error in NFSv4 readdir requests.Manoj Naik2005-06-221-7/+17
| | | | | | | | Request RDATTR_ERROR as an attribute in readdir to distinguish between a directory being within an absent filesystem or one (or more) of its entries. Signed-off-by: Manoj Naik <manoj@almaden.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* [PATCH] NFSv4: Client-side xdr for writing NFSv4 aclsJ. Bruce Fields2005-06-221-1/+70
| | | | | | | | Client-side support for NFSv4 acls: xdr encoding and decoding routines for writing acls Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* [PATCH] NFSv4: Client-side xdr for reading NFSv4 aclsJ. Bruce Fields2005-06-221-0/+100
| | | | | | | | Client-side support for NFSv4 acls: xdr encoding and decoding routines for reading acls Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* [PATCH] NFSv4: fix fattr size calculationsJ. Bruce Fields2005-06-221-7/+11
| | | | | | | | Make nfs4 fattr size calculations more explicit, revising them downward a bit in the process. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* [PATCH] NFS: Header file cleanup...Trond Myklebust2005-06-221-7/+1
| | | | | | | - Move NFSv4 state definitions into a private header file. - Clean up gunk in nfs_fs.h Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-161-0/+4034
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
OpenPOWER on IntegriCloud