History log of /openbmc/linux/fs/nfs/dir.c (Results 1051 – 1075 of 1088)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 54ceac45 22-Aug-2006 David Howells <dhowells@redhat.com>

NFS: Share NFS superblocks per-protocol per-server per-FSID

The attached patch makes NFS share superblocks between mounts from the same
server and FSID over the same protocol.

I

NFS: Share NFS superblocks per-protocol per-server per-FSID

The attached patch makes NFS share superblocks between mounts from the same
server and FSID over the same protocol.

It does this by creating each superblock with a false root and returning the
real root dentry in the vfsmount presented by get_sb(). The root dentry set
starts off as an anonymous dentry if we don't already have the dentry for its
inode, otherwise it simply returns the dentry we already have.

We may thus end up with several trees of dentries in the superblock, and if at
some later point one of anonymous tree roots is discovered by normal filesystem
activity to be located in another tree within the superblock, the anonymous
root is named and materialises attached to the second tree at the appropriate
point.

Why do it this way? Why not pass an extra argument to the mount() syscall to
indicate the subpath and then pathwalk from the server root to the desired
directory? You can't guarantee this will work for two reasons:

(1) The root and intervening nodes may not be accessible to the client.

With NFS2 and NFS3, for instance, mountd is called on the server to get
the filehandle for the tip of a path. mountd won't give us handles for
anything we don't have permission to access, and so we can't set up NFS
inodes for such nodes, and so can't easily set up dentries (we'd have to
have ghost inodes or something).

With this patch we don't actually create dentries until we get handles
from the server that we can use to set up their inodes, and we don't
actually bind them into the tree until we know for sure where they go.

(2) Inaccessible symbolic links.

If we're asked to mount two exports from the server, eg:

mount warthog:/warthog/aaa/xxx /mmm
mount warthog:/warthog/bbb/yyy /nnn

We may not be able to access anything nearer the root than xxx and yyy,
but we may find out later that /mmm/www/yyy, say, is actually the same
directory as the one mounted on /nnn. What we might then find out, for
example, is that /warthog/bbb was actually a symbolic link to
/warthog/aaa/xxx/www, but we can't actually determine that by talking to
the server until /warthog is made available by NFS.

This would lead to having constructed an errneous dentry tree which we
can't easily fix. We can end up with a dentry marked as a directory when
it should actually be a symlink, or we could end up with an apparently
hardlinked directory.

With this patch we need not make assumptions about the type of a dentry
for which we can't retrieve information, nor need we assume we know its
place in the grand scheme of things until we actually see that place.

This patch reduces the possibility of aliasing in the inode and page caches for
inodes that may be accessed by more than one NFS export. It also reduces the
number of superblocks required for NFS where there are many NFS exports being
used from a server (home directory server + autofs for example).

This in turn makes it simpler to do local caching of network filesystems, as it
can then be guaranteed that there won't be links from multiple inodes in
separate superblocks to the same cache file.

Obviously, cache aliasing between different levels of NFS protocol could still
be a problem, but at least that gives us another key to use when indexing the
cache.

This patch makes the following changes:

(1) The server record construction/destruction has been abstracted out into
its own set of functions to make things easier to get right. These have
been moved into fs/nfs/client.c.

All the code in fs/nfs/client.c has to do with the management of
connections to servers, and doesn't touch superblocks in any way; the
remaining code in fs/nfs/super.c has to do with VFS superblock management.

(2) The sequence of events undertaken by NFS mount is now reordered:

(a) A volume representation (struct nfs_server) is allocated.

(b) A server representation (struct nfs_client) is acquired. This may be
allocated or shared, and is keyed on server address, port and NFS
version.

(c) If allocated, the client representation is initialised. The state
member variable of nfs_client is used to prevent a race during
initialisation from two mounts.

(d) For NFS4 a simple pathwalk is performed, walking from FH to FH to find
the root filehandle for the mount (fs/nfs/getroot.c). For NFS2/3 we
are given the root FH in advance.

(e) The volume FSID is probed for on the root FH.

(f) The volume representation is initialised from the FSINFO record
retrieved on the root FH.

(g) sget() is called to acquire a superblock. This may be allocated or
shared, keyed on client pointer and FSID.

(h) If allocated, the superblock is initialised.

(i) If the superblock is shared, then the new nfs_server record is
discarded.

(j) The root dentry for this mount is looked up from the root FH.

(k) The root dentry for this mount is assigned to the vfsmount.

(3) nfs_readdir_lookup() creates dentries for each of the entries readdir()
returns; this function now attaches disconnected trees from alternate
roots that happen to be discovered attached to a directory being read (in
the same way nfs_lookup() is made to do for lookup ops).

The new d_materialise_unique() function is now used to do this, thus
permitting the whole thing to be done under one set of locks, and thus
avoiding any race between mount and lookup operations on the same
directory.

(4) The client management code uses a new debug facility: NFSDBG_CLIENT which
is set by echoing 1024 to /proc/net/sunrpc/nfs_debug.

(5) Clone mounts are now called xdev mounts.

(6) Use the dentry passed to the statfs() op as the handle for retrieving fs
statistics rather than the root dentry of the superblock (which is now a
dummy).

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


# 8fa5c000 22-Aug-2006 David Howells <dhowells@redhat.com>

NFS: Move rpc_ops from nfs_server to nfs_client

Move the rpc_ops from the nfs_server struct to the nfs_client struct as they're
common to all server records of a particular NFS protocol

NFS: Move rpc_ops from nfs_server to nfs_client

Move the rpc_ops from the nfs_server struct to the nfs_client struct as they're
common to all server records of a particular NFS protocol version.

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


Revision tags: v2.6.18-rc4, v2.6.18-rc3
# 979df72e 25-Jul-2006 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Add an ACCESS cache memory shrinker

A pinned inode may in theory end up filling memory with cached ACCESS
calls. This patch ensures that the VM may shrink away the cache in these

NFS: Add an ACCESS cache memory shrinker

A pinned inode may in theory end up filling memory with cached ACCESS
calls. This patch ensures that the VM may shrink away the cache in these
particular cases.
The shrinker works by iterating through the list of inodes on the global
nfs_access_lru_list, and removing the least recently used access
cache entry until it is done (or until the entire cache is empty).

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


# cfcea3e8 25-Jul-2006 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Add a global LRU list for the ACCESS cache

...in order to allow the addition of a memory shrinker.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>


# 1c3c07e9 25-Jul-2006 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Add a new ACCESS rpc call cache to the linux nfs client

The current access cache only allows one entry at a time to be cached for each
inode. Add a per-inode red-black tree in order

NFS: Add a new ACCESS rpc call cache to the linux nfs client

The current access cache only allows one entry at a time to be cached for each
inode. Add a per-inode red-black tree in order to allow more than one to
be cached at a time.

Should significantly cut down the time spent in path traversal for shared
directories such as ${PATH}, /usr/share, etc.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


Revision tags: v2.6.18-rc2, v2.6.18-rc1
# 4e0641a7 05-Jul-2006 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Optimise away an excessive GETATTR call when a file is symlinked

In the case when compiling via a symlink tree, we want to ensure that the
close-to-open GETATTR call is applied only

NFS: Optimise away an excessive GETATTR call when a file is symlinked

In the case when compiling via a symlink tree, we want to ensure that the
close-to-open GETATTR call is applied only to the final file, and not to
the symlink.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


Revision tags: v2.6.17
# 55a97593 09-Jun-2006 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Ensure the client submounts, when it crosses a server mountpoint.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>


Revision tags: v2.6.17-rc6
# 44b11874 25-May-2006 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Separate metadata and page cache revalidation mechanisms

Separate out the function of revalidating the inode metadata, and
revalidating the mapping. The former may be called by look

NFS: Separate metadata and page cache revalidation mechanisms

Separate out the function of revalidating the inode metadata, and
revalidating the mapping. The former may be called by lookup(),
and only really needs to check that permissions, ctime, etc haven't changed
whereas the latter needs only done when we want to read data from the page
cache, and may need to sync and then invalidate the mapping.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


Revision tags: v2.6.17-rc5, v2.6.17-rc4, v2.6.17-rc3
# 7451c4f0 19-Apr-2006 Carsten Otte <cotte@de.ibm.com>

NFS: remove needless check in nfs_opendir()

Local variable res was initialized to 0 - no check needed here.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Cc: Trond Myklebust <t

NFS: remove needless check in nfs_opendir()

Local variable res was initialized to 0 - no check needed here.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


Revision tags: v2.6.17-rc2, v2.6.17-rc1
# 4b6f5d20 28-Mar-2006 Arjan van de Ven <arjan@infradead.org>

[PATCH] Make most file operations structs in fs/ const

This is a conversion to make the various file_operations structs in fs/
const. Basically a regexp job, with a few manual fixups

[PATCH] Make most file operations structs in fs/ const

This is a conversion to make the various file_operations structs in fs/
const. Basically a regexp job, with a few manual fixups

The goal is both to increase correctness (harder to accidentally write to
shared datastructures) and reducing the false sharing of cachelines with
things that get dirty in .data (while .rodata is nicely read only and thus
cache clean)

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

show more ...


# 03f28e3a 20-Mar-2006 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Make nfs_fhget() return appropriate error values

Currently it returns NULL, which usually gets interpreted as ENOMEM. In
fact it can mean a host of issues.

Signed-off-by: T

NFS: Make nfs_fhget() return appropriate error values

Currently it returns NULL, which usually gets interpreted as ENOMEM. In
fact it can mean a host of issues.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


# 1e7cb3dc 20-Mar-2006 Chuck Lever <cel@netapp.com>

NFS: directory trace messages

Reuse NFSDBG_DIRCACHE and NFSDBG_LOOKUPCACHE to provide additional
diagnostic messages that trace the operation of the NFS client's
directory behavior.

NFS: directory trace messages

Reuse NFSDBG_DIRCACHE and NFSDBG_LOOKUPCACHE to provide additional
diagnostic messages that trace the operation of the NFS client's
directory behavior. A few new messages are now generated when NFSDBG_VFS
is active, as well, to trace normal VFS activity. This compromise
provides better trace debugging for those who use pre-built kernels,
without adding a lot of extra noise to the standard debug settings.

Test-plan:
Enable NFS trace debugging with flags 1, 2, or 4. You should be able to
see different types of trace messages with each flag setting.

Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


# 91d5b470 20-Mar-2006 Chuck Lever <cel@netapp.com>

NFS: add I/O performance counters

Invoke the byte and event counter macros where we want to count bytes and
events.

Clean-up: fix a possible NULL dereference in nfs_lock, and si

NFS: add I/O performance counters

Invoke the byte and event counter macros where we want to count bytes and
events.

Clean-up: fix a possible NULL dereference in nfs_lock, and simplify
nfs_file_open.

Test-plan:
fsx and iozone on UP and SMP systems, with and without pre-emption. Watch
for memory overwrite bugs, and performance loss (significantly more CPU
required per op).

Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


Revision tags: v2.6.16, v2.6.16-rc6, v2.6.16-rc5, v2.6.16-rc4, v2.6.16-rc3, v2.6.16-rc2, v2.6.16-rc1
# 1b1dcc1b 09-Jan-2006 Jes Sorensen <jes@sgi.com>

[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem

This patch converts the inode semaphore to a mutex. I have tested it on
XFS and compiled as much as one can consider on an ia64.

[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem

This patch converts the inode semaphore to a mutex. I have tested it on
XFS and compiled as much as one can consider on an ia64. Anyway your
luck with it might be different.

Modified-by: Ingo Molnar <mingo@elte.hu>

(finished the conversion)

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

show more ...


# 24174119 03-Jan-2006 Trond Myklebust <Trond.Myklebust@netapp.com>

NFSv4: Ensure that we return the delegation on the target of a rename too.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>


Revision tags: v2.6.15, v2.6.15-rc7, v2.6.15-rc6, v2.6.15-rc5
# 5ba7cc48 03-Dec-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Fix post-op attribute revalidation...

- Missing nfs_mark_for_revalidate in nfs_proc_link()
- Missing nfs_mark_for_revalidate in nfs_rename()

Signed-off-by: Trond Mykle

NFS: Fix post-op attribute revalidation...

- Missing nfs_mark_for_revalidate in nfs_proc_link()
- Missing nfs_mark_for_revalidate in nfs_rename()

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


Revision tags: v2.6.15-rc4, v2.6.15-rc3, v2.6.15-rc2, v2.6.15-rc1
# 34ea8188 04-Nov-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

NFSv4: Return any delegations before sillyrenaming the file

I missed this one... Any form of rename will result in a delegation
recall, so it is more efficient to return the one we hol

NFSv4: Return any delegations before sillyrenaming the file

I missed this one... Any form of rename will result in a delegation
recall, so it is more efficient to return the one we hold before
trying the rename.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


# cf809556 27-Oct-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Ensure that nfs_link() instantiates the dentry correctly

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>


Revision tags: v2.6.14
# 0c70b501 25-Oct-2005 Chuck Lever <cel@netapp.com>

NFS: nfs_lookup doesn't need to revalidate the parent directory's inode

nfs_lookup() used to consult a lookup cache before trying an actual wire
lookup operation. The lookup cache wou

NFS: nfs_lookup doesn't need to revalidate the parent directory's inode

nfs_lookup() used to consult a lookup cache before trying an actual wire
lookup operation. The lookup cache would be invalid, of course, if the
parent directory's mtime had changed, so nfs_lookup performed an inode
revalidation on the parent.

Since nfs_lookup() doesn't use a cache anymore, the revalidation is no
longer necessary. There are cases where it will generate a lot of
unnecessary GETATTR traffic.

See http://bugzilla.linux-nfs.org/show_bug.cgi?id=9

Test-plan:
Use lndir and "rm -rf" and watch for excess GETATTR traffic or application
level errors.

Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


# 0e574af1 27-Oct-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Cleanup initialisation of struct nfs_fattr

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>


Revision tags: v2.6.14-rc5
# 6fe43f9e 18-Oct-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Fix rename of directory onto empty directory

If someone tries to rename a directory onto an empty directory, we
currently fail and return EBUSY.
This patch ensures that we tr

NFS: Fix rename of directory onto empty directory

If someone tries to rename a directory onto an empty directory, we
currently fail and return EBUSY.
This patch ensures that we try the rename if both source and target
are directories, and that we fail with a correct error of EISDIR if
the source is not a directory.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


# cae7a073 18-Oct-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

NFSv4: Return delegation upon rename or removal of file.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>


# 6f926b5b 18-Oct-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

[NFS]: Check that the server returns a valid regular file to our OPEN request

Since it appears that some servers don't...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.co

[NFS]: Check that the server returns a valid regular file to our OPEN request

Since it appears that some servers don't...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


# 02a913a7 18-Oct-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

NFSv4: Eliminate nfsv4 open race...

Make NFSv4 return the fully initialized file pointer with the
stateid that it created in the lookup w/intent.

Signed-off-by: Trond Myklebu

NFSv4: Eliminate nfsv4 open race...

Make NFSv4 return the fully initialized file pointer with the
stateid that it created in the lookup w/intent.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


Revision tags: v2.6.14-rc4, v2.6.14-rc3, v2.6.14-rc2, v2.6.14-rc1, v2.6.13
# 9aa48b7e 25-Aug-2005 Trond Myklebust <Trond.Myklebust@netapp.com>

NFS: Don't expose internal READDIR errors to userspace

Fixes a condition whereby the kernel is returning the non-POSIX error
EBADCOOKIE to userspace.

Signed-off-by: Trond Myk

NFS: Don't expose internal READDIR errors to userspace

Fixes a condition whereby the kernel is returning the non-POSIX error
EBADCOOKIE to userspace.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

show more ...


1...<<41424344