aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
Commit message (Collapse)AuthorAge
* NFS: Remove the BKL from nfs_link()Trond Myklebust2008-07-15
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove the BKL from the inode creation operationsTrond Myklebust2008-07-15
| | | | | | | nfs_instantiate() does not require the BKL, neither do the attribute updates or the RPC code. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove BKL usage from open()Trond Myklebust2008-07-15
| | | | | | | All the NFSv4 stateful operations are already protected by other locks (in particular by the rpc_sequence locks. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove the BKL from the permission checking codeTrond Myklebust2008-07-15
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Protect inode->i_nlink updates using inode->i_lockTrond Myklebust2008-07-15
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Use NFSDBG_FILE for all fopsChuck Lever2008-07-09
| | | | | | | | | Clean up: some fops use NFSDBG_FILE, some use NFSDBG_VFS. Let's use NFSDBG_FILE for all fops, and consistently report file names instead of inode numbers. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Make nfs_open methods consistentChuck Lever2008-07-09
| | | | | | | | Clean up: Report the same debugging info and count function calls the same for files and directories in nfs_opendir() and nfs_file_open(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Make nfs_llseek methods consistentChuck Lever2008-07-09
| | | | | | | | Clean up: Report the same debugging info in nfs_llseek_dir() and nfs_llseek_file(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Make nfs_fsync methods consistentChuck Lever2008-07-09
| | | | | | | | Clean up: Report the same debugging info, count function calls the same, and use similar function naming in nfs_fsync_dir() and nfs_fsync(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix readdir cache invalidationTrond Myklebust2008-07-08
| | | | | | | | | | | | | | invalidate_inode_pages2_range() takes page offset arguments, not byte ranges. Another thought is that individual pages might perhaps get evicted by VM pressure, in which case we might perhaps want to re-read not only the evicted page, but all subsequent pages too (in case the server returns more/less data per page so that the alignment of the next entry changes). We should therefore remove the condition that we only do this on page->index==0. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* nfs: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-05-16
| | | | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* Merge branch 'devel'Trond Myklebust2008-04-24
|\
| * SUNRPC: Add a helper rpcauth_lookup_generic_cred()Trond Myklebust2008-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NFSv4 protocol allows clients to negotiate security protocols on the fly in the case where an administrator on the server changes the export settings and/or in the case where we may have a filesystem migration event. Instead of having the NFS client code cache credentials that are tied to a particular AUTH method it is therefore preferable to have a generic credential that can be converted into whatever AUTH is in use by the RPC client when the read/write/sillyrename/... is put on the wire. We do this by means of the new "generic" credential, which basically just caches the minimal information that is needed to look up an RPCSEC_GSS, AUTH_SYS, or AUTH_NULL credential. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | [PATCH] r/o bind mounts: check mnt instead of superblock directlyDave Hansen2008-04-19
|/ | | | | | | | | | | | | | | | | | | If we depend on the inodes for writeability, we will not catch the r/o mounts when implemented. This patches uses __mnt_want_write(). It does not guarantee that the mount will stay writeable after the check. But, this is OK for one of the checks because it is just for a printk(). The other two are probably unnecessary and duplicate existing checks in the VFS. This won't make them better checks than before, but it will make them detect r/o mounts. Acked-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* NFS: Fix dentry revalidation for NFSv4 referrals and mountpoint crossingsTrond Myklebust2008-03-07
| | | | | | | | | | As long as the directory contents haven't changed, we should just let the path walk proceed to cross the mountpoint. Apart from being an optimisation in the case of 'nohide' mountpoint traversals, it also fixes an issue with referrals: referral inodes don't have valid filehandles, so calling nfs_revalidate_inode() on them is a bug. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: remove error field from nfs_readdir_descriptor_tJeff Layton2008-02-13
| | | | | | | | | The error field in nfs_readdir_descriptor_t is never used outside of the function in which it is set. Remove the field and change the place that does use it to use an existing local variable. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix a potential race between umount and nfs_access_cache_shrinker()Trond Myklebust2008-01-30
| | | | | | Thanks to Yawei Niu for spotting the race. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Add an asynchronous delegreturn operation for use in nfs_clear_inodeTrond Myklebust2008-01-30
| | | | | | | | Otherwise, there is a potential deadlock if the last dput() from an NFSv4 close() or other asynchronous operation leads to nfs_clear_inode calling the synchronous delegreturn. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* nfs: obliterate NFS_FLAGS macroBenny Halevy2008-01-30
| | | | | | | use NFS_I(inode)->flags instead Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: define a function to update nfsi->cache_change_attributeTrond Myklebust2008-01-30
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Ensure that we eject stale inodes as soon as possibleTrond Myklebust2008-01-30
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Handle -ENOENT errors in unlink()/rmdir()/rename()Trond Myklebust2008-01-30
| | | | | | | If the server returns an ENOENT error, we still need to do a d_delete() in order to ensure that the dentry is deleted. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix a sillyrename race...Trond Myklebust2008-01-30
| | | | | | | | | | | Ensure that readdir revalidates its data cache after blocking on sillyrename. Also fix a typo in nfs_do_call_unlink(): swap the ^= for an |=. The result is the same, since we've already checked that the flag is unset, but it makes the code more readable. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: fs/nfs/dir.c should #include "internal.h"Adrian Bunk2007-11-26
| | | | | | | | | | | Every file should include the headers containing the prototypes for its global functions (in this case nfs_access_cache_shrinker()). Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix a race in sillyrenameTrond Myklebust2007-10-19
| | | | | | | | | | | | | | | | | lookup() and sillyrename() can race one another because the sillyrename() completion cannot take the parent directory's inode->i_mutex since the latter may be held by whoever is calling dput(). We therefore have little option but to add extra locking to ensure that nfs_lookup() and nfs_atomic_open() do not race with the sillyrename completion. If somebody has looked up the sillyrenamed file in the meantime, we just transfer the sillydelete information to the new dentry. Please refer to the bug-report at http://bugzilla.linux-nfs.org/show_bug.cgi?id=150 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Add a boot parameter to disable 64 bit inode numbersTrond Myklebust2007-10-09
| | | | | | | | This boot parameter will allow legacy 32-bit applications which call stat() to continue to function even if the NFSv3/v4 server uses 64-bit inode numbers. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Get rid of some obsolete macrosTrond Myklebust2007-10-09
| | | | | | | - NFS_READTIME, NFS_CHANGE_ATTR are completely unused. - Inline the few remaining uses of NFS_ATTRTIMEO, and remove. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Simplify filehandle revalidationTrond Myklebust2007-10-09
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Ensure that nfs_link() returns a hashed dentryTrond Myklebust2007-10-09
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Be strict about dentry revalidation when doing exclusive createTrond Myklebust2007-10-09
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Don't zap the readdir caches upon errorTrond Myklebust2007-10-09
| | | | | | If necessary, the caches will get zapped under normal revalidation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove the redundant nfs_reval_fsid()Trond Myklebust2007-10-09
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Fix nfs_atomic_open() to set the verifier on negative dentries tooTrond Myklebust2007-10-09
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Use NFSv2/v3 rules for negative dentries in nfs_open_revalidateTrond Myklebust2007-10-09
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Don't revalidate the directory in nfs_atomic_lookup()Trond Myklebust2007-10-09
| | | | | | Why bother, since the call to nfs4_atomic_open() will do it for us. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Optimise nfs_lookup_revalidate()Trond Myklebust2007-10-09
| | | | | | | We don't need to call nfs_revalidate_inode() on the directory if we already know that the verifiers don't match. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove nfs_begin_data_update/nfs_end_data_updateTrond Myklebust2007-10-09
| | | | | | | The lower level routines in fs/nfs/proc.c, fs/nfs/nfs3proc.c and fs/nfs/nfs4proc.c should already be dealing with the revalidation issues. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: NFS_CACHEINV() should not test for nfs_caches_unstable()Trond Myklebust2007-10-09
| | | | | | | | | | The fact that we're in the process of modifying the inode does not mean that we should not invalidate the attribute and data caches. The defensive thing is to always invalidate when we're confronted with inode mtime/ctime or change_attribute updates that we do not immediately recognise. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove bogus nfs_mark_for_revalidate() in nfs_lookupTrond Myklebust2007-10-09
| | | | | | The parent of the newly materialised dentry has just been revalidated... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: don't cache the verifer across ->lookup() callsTrond Myklebust2007-10-09
| | | | | | | | If the ->lookup() call causes the directory verifier to change, then there is still no need to use the old verifier, since our dentry has been verified. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix a bug in nfs_open_revalidate()Trond Myklebust2007-10-09
| | | | | | | We want to set the verifier when the call to nfs4_open_revalidate() _succeeds_. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Don't hash the negative dentry when optimising for an O_EXCL openTrond Myklebust2007-10-09
| | | | | | | We don't want to leave an unverified hashed negative dentry if the exclusive create fails to complete. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: nfs_instantiate() should set the dentry verifierTrond Myklebust2007-10-09
| | | | | | | That will also allow us to remove the calls in mknod and mkdir. In addition it will ensure that symlinks set it correctly. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Ensure nfs_instantiate() invalidates the parent dir on errorTrond Myklebust2007-10-09
| | | | | | Also ensure that it drops the dentry in this case. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix nfs_verify_change_attribute()Trond Myklebust2007-10-09
| | | | | | | | | We don't care about whether or not some other process on our client is changing the directory while we're in nfs_lookup_revalidate(), because the dcache will take care of ensuring local atomicity. We can therefore remove the test for nfs_caches_unstable(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix atime revalidation in readdir()Trond Myklebust2007-10-09
| | | | | | | | NFSv3 will correctly update atime on a readdir call, so there is no need to set the NFS_INO_INVALID_ATIME flag unless the call to nfs_refresh_inode() fails. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Don't use readdirplus data if the page cache is invalidTrond Myklebust2007-10-09
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix dcache revalidation bugsTrond Myklebust2007-10-09
| | | | | | | | | | | We don't need to force a dentry lookup just because we're making changes to the directory. Don't update nfsi->cache_change_attribute in nfs_end_data_update: that overrides the NFSv3/v4 weak consistency checking that tells us our update was the only one, and that tells us the dcache is still valid. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Simplify _nfs4_do_access()Trond Myklebust2007-10-09
| | | | | | | | Currently, _nfs4_do_access() is just a copy of nfs_do_access() with added conversion of the open flags into an access mask. This patch merges the duplicate functionality. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Replace file->private_data with calls to nfs_file_open_context()Trond Myklebust2007-10-09
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>