aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs
AgeCommit message (Collapse)Author
2007-07-10NFSv4: Use RCU to protect delegationsTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Support recalling delegations by stateid part 2Trond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Support recalling delegations by stateidTrond Myklebust
There appear to be some rogue servers out there that issue multiple delegations with different stateids for the same file. Ensure that when we return delegations, we do so on a per-stateid basis rather than a per-file basis. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Fix up a bug in nfs4_open_recover()Trond Myklebust
Don't clobber the delegation info... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: set the delegation in nfs4_opendata_to_nfs4_stateTrond Myklebust
This ensures that nfs4_open_release() and nfs4_open_confirm_release() can now handle an eventual delegation that was returned with out open. As such, it fixes a delegation "leak" when the user breaks out of an open call. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Fix a bug in __nfs4_find_state_byownerTrond Myklebust
The test for state->state == 0 does not tell you that the stateid is in the process of being freed. It really tells you that the stateid is not yet initialised... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Fix atomic open for execute...Trond Myklebust
Currently we do not check for the FMODE_EXEC flag as we should. For that particular case, we need to perform an ACCESS call to the server in order to check that the file is executable. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Reduce the chances of an open_owner identifier collisionTrond Myklebust
Currently we just use a 32-bit counter. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: nfs_increment_open_seqid should not return a valueTrond Myklebust
It is a void function... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Fix underestimate of NFSv4 lookup request sizeTrond Myklebust
Also fix up the underestimate of fs_locations Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Fix the underestimate of NFSv4 open request sizeTrond Myklebust
The maximum size depends on the filename size and a number of other elements which are currently not being counted. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Fix the NFSv4 owner and owner_group size estimatesTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Don't reuse expired nfs4_state_owner structsTrond Myklebust
That just confuses certain NFSv4 servers. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Fix a credential reference leak in nfs4_get_state_owner()Trond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Replace NFS_I(inode)->req_lock with inode->i_lockTrond Myklebust
There is no justification for keeping a special spinlock for the exclusive use of the NFS writeback code. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Clean up _nfs4_proc_lookup() vs _nfs4_proc_lookupfh()Trond Myklebust
They differ only slightly in the arguments they take. Why have they not been merged? Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10SUNRPC: Remove the tk_auth macro...Trond Myklebust
We should almost always be deferencing the rpc_auth struct by means of the credential's cr_auth field instead of the rpc_clnt->cl_auth anyway. Fix up that historical mistake, and remove the macro that propagated it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10SUNRPC: Remove redundant calls to rpciod_up()/rpciod_down()Trond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10SUNRPC: Kill rpc_clnt->cl_oneshotTrond Myklebust
Replace it with explicit calls to rpc_shutdown_client() or rpc_destroy_client() (for the case of asynchronous calls). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Convert struct nfs4_opendata to use struct krefTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Convert struct nfs_open_context to use a krefTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: reduce latency by using conditional rescheduling in nfs_scan_listTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Prevent integer overflow in nfs_scan_list()Trond Myklebust
Also ensure that nfs_inode ncommit and npages are large enough to represent all possible values for the number of pages. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Remove the redundant 'dirty' and 'commit' lists from nfs_inodeTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS cleanup: speed up nfs_scan_commit using radix tree tagsTrond Myklebust
Add a tag for requests that are waiting for a COMMIT Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS cleanup: Rename NFS_PAGE_TAG_WRITEBACK to NFS_PAGE_TAG_LOCKEDTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Convert struct nfs_page to use krefsTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Fix an Oops in the nfs_access_cache_shrinker()Trond Myklebust
The nfs_access_cache_shrinker may race with nfs_access_zap_cache(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: nfs3_proc_create() should use nfs_post_op_update_inode()Trond Myklebust
Also get rid of a redundant call to nfs_setattr_update_inode(). The call to nfs3_proc_setattr() already takes care of that. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS4: on a O_EXCL OPEN make sure SETATTR sets the fields holding the verifierJeff Layton
The Linux NFS4 client simply skips over the bitmask in an O_EXCL open call and so it doesn't bother to reset any fields that may be holding the verifier. This patch has us save the first two words of the bitmask (which is all the current client has #defines for). The client then later checks this bitmask and turns on the appropriate flags in the sattr->ia_verify field for the following SETATTR call. This patch only currently checks to see if the server used the atime and mtime slots for the verifier (which is what the Linux server uses for this). I'm not sure of what other fields the server could reasonably use, but adding checks for others should be trivial. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Re-enable forced umountsTrond Myklebust
They disappeared some time around 2.6.18. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Use GFP_HIGHUSER for page allocation in nfs_symlink()Jeff Layton
nfs_symlink() allocates a GFP_KERNEL page for the pagecache. Most pagecache pages are allocated using GFP_HIGHUSER, and there's no reason not to do that in nfs_symlink() as well. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2007-07-10NFS: Fix nfs_reval_fsid()Trond Myklebust
We don't need to revalidate the fsid on the root directory. It suffices to revalidate it on the current directory. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Clean up nfs4_call_async()Trond Myklebust
Use rpc_run_task() instead of doing it ourselves. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Ensure that nfs4_do_close() doesn't race with umountTrond Myklebust
nfs4_do_close() does not currently have any way to ensure that the user won't attempt to unmount the partition while the asynchronous RPC call is completing. This again may cause Oopses in nfs_update_inode(). Add a vfsmount argument to nfs4_close_state to ensure that the partition remains mounted while we're closing the file. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Ensure asynchronous open() calls always pin the mountpointTrond Myklebust
A number of race conditions may currently ensue if the user presses ^C and then unmounts the partition while an asynchronous open() is in progress. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFSv4: Cleanup: pass the nfs_open_context to open recovery codeTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Replace vfsmount and dentry in nfs_open_context with struct pathTrond Myklebust
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Minor read optimisation...Trond Myklebust
Since PG_uptodate may now end up getting set during the call to nfs_wb_page(), we can avoid putting a read request on the wire in those situations. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Don't mark a written page as uptodate until it is on diskTrond Myklebust
The write may fail, so we should not mark the page as uptodate until we are certain that the data has been accepted and written to disk by the server. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Don't fail an O_DIRECT read/write if get_user_pages() returns pagesTrond Myklebust
There is no need to fail the entire O_DIRECT read/write just because get_user_pages() returned fewer pages than we requested. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10NFS: Clean ups in fs/nfs/direct.cChuck Lever
Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-07-10sendfile: convert nfs to using splice_read()Jens Axboe
Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-05-30NFS: Fix a refcount leakage in O_DIRECTTrond Myklebust
The current code is leaking a reference to dreq->kref when the calls to nfs_direct_read_schedule() and nfs_direct_write_schedule() return an error. This patch moves the call to kref_put() from nfs_direct_wait() back into nfs_direct_read() and nfs_direct_write() (which are the functions that actually took the reference in the first place) fixing the leak. Thanks to Denis V. Lunev for spotting the bug and proposing the original fix. Acked-by: Denis V. Lunev <dlunev@gmail.com> Acked-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-05-24NFS: Fix nfs_direct_dirty_pages()Trond Myklebust
We only need to dirty the pages that were actually read in. Also convert nfs_direct_dirty_pages() to call set_page_dirty() instead of set_page_dirty_lock(). A call to lock_page() is unacceptable in an rpciod callback function. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-05-24NFS: Fix handful of compiler warnings in direct.cChuck Lever
This patch fixes a couple of signage issues that were causing an Oops when running the LTP diotest4 test. get_user_pages() returns a signed error, hence we need to be careful when comparing with the unsigned number of pages from data->npages. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-05-24NFS: Avoid a deadlock situation on writeTrond Myklebust
When processes are allowed to attempt to lock a non-contiguous range of nfs write requests, it is possible for generic_writepages to 'wrap round' the address space, and call writepage() on a request that is already locked by the same process. We avoid the deadlock by checking if the page index is contiguous with the list of nfs write requests that is already held in our nfs_pageio_descriptor prior to attempting to lock a new request. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2007-05-21Detach sched.h from mm.hAlexey Dobriyan
First thing mm.h does is including sched.h solely for can_do_mlock() inline function which has "current" dereference inside. By dealing with can_do_mlock() mm.h can be detached from sched.h which is good. See below, why. This patch a) removes unconditional inclusion of sched.h from mm.h b) makes can_do_mlock() normal function in mm/mlock.c c) exports can_do_mlock() to not break compilation d) adds sched.h inclusions back to files that were getting it indirectly. e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were getting them indirectly Net result is: a) mm.h users would get less code to open, read, preprocess, parse, ... if they don't need sched.h b) sched.h stops being dependency for significant number of files: on x86_64 allmodconfig touching sched.h results in recompile of 4083 files, after patch it's only 3744 (-8.3%). Cross-compile tested on all arm defconfigs, all mips defconfigs, all powerpc defconfigs, alpha alpha-up arm i386 i386-up i386-defconfig i386-allnoconfig ia64 ia64-up m68k mips parisc parisc-up powerpc powerpc-up s390 s390-up sparc sparc-up sparc64 sparc64-up um-x86_64 x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig as well as my two usual configs. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-17Merge branch 'master' of /home/trondmy/repositories/git/linux-2.6/Trond Myklebust
2007-05-17Remove SLAB_CTOR_CONSTRUCTORChristoph Lameter
SLAB_CTOR_CONSTRUCTOR is always specified. No point in checking it. Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: David Howells <dhowells@redhat.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Steven French <sfrench@us.ibm.com> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Miklos Szeredi <miklos@szeredi.hu> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Dave Kleikamp <shaggy@austin.ibm.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Anton Altaparmakov <aia21@cantab.net> Cc: Mark Fasheh <mark.fasheh@oracle.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Jan Kara <jack@ucw.cz> Cc: David Chinner <dgc@sgi.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>