NFS client patches for Linux 2.6.27-rc7

The following set of patches fix known issues with the 2.6.27-rc7 NFS client code, and significantly enhance the support for NFSv4.

linux-2.6.27-001-fix_nfs_file_llseek.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 23 Sep 2008 17:28:35 -0400

NFS: Fix nfs_file_llseek()

After the BKL removal patches were applied to the rest of the NFS code, the BKL protection in nfs_file_llseek() is no longer sufficient to ensure that inode->i_size is read safely in generic_file_llseek_unlocked().

In order to fix the situation, we either have to replace the naked read of inode->i_size in generic_file_llseek_unlocked() with i_size_read(), or the whole thing needs to be executed under the inode->i_lock; In order to avoid disrupting other filesystems, avoid touching generic_file_llseek_unlocked() for now...

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

linux-2.6.27-002-cleanup_unlink.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Sun, 27 Jul 2008 18:19:01 -0400

NFS: Clean up nfs_sb_active/nfs_sb_deactive

Instead of causing umount requests to block on server->active_wq while the asynchronous sillyrename deletes are executing, we can use the sb->s_active counter to obtain a reference to the super_block, and then release that reference in nfs_async_unlink_release().

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

linux-2.6.27-003-stricter_lookup_cache.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 15 Jul 2008 17:58:13 -0400

NFS: Add options for finer control of the lookup cache

Add a flag to turn off the caching of negative dentries. Add a flag for enforcing stricter revalidation of all dentries.

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

linux-2.6.27-004-dont_apply_nfs_mount_flagmask_to_text_mounts.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 15 Aug 2008 16:59:14 -0400

NFS: Don't apply NFS_MOUNT_FLAGMASK to text-based mounts

The point of introducing text-based mounts was to allow us to add functionality without having to worry about legacy binary mount formats. The mask should be there in order to ensure that binary formats don't start enabling features that they cannot support. There is no justification for applying it to the text mount path.

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

linux-2.6.27-005-lookupcache_mount_options.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 15 Jul 2008 17:58:14 -0400

NFS: Add mount options for controlling the lookup cache

Add the following NFS-specific mount options to the parser.

-o lookupcache=all /* Default: cache positive & negative dentries */ -o lookupcache=pos[itive] /* Don't cache negative dentries */ -o lookupcache=none /* Strict revalidation of all dentries */

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

linux-2.6.27-006-fix_attribute_update.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 23 Sep 2008 17:28:41 -0400

NFS: Fix the NFS attribute update

Currently nfs_refresh_inode() will only update the inode metadata if it sees that the RPC call that returned the nfs_fattr was started after the last update of the inode. This means that if we have parallel RPC calls to the same inode (when sending WRITE calls, for instance), we may often miss updates.

This patch attempts to recover those missed updates by also accepting them if the ctime in the nfs_fattr is more recent than the inode's cached ctime. It also recovers the case where the file size has increased, but the ctime has not been updated due to limited ctime resolution.

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

linux-2.6.27-007-fix_nfs_revalidate_inode.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 23 Sep 2008 17:28:42 -0400

NFS: Convert __nfs_revalidate_inode() to use nfs_refresh_inode()

In the case where there are parallel RPC calls to the same inode, we may receive stale metadata due to the lack of ordering, hence the sanity checking of metadata in nfs_refresh_inode(). Currently, __nfs_revalidate_inode() is calling nfs_update_inode() directly, without any further sanity checks, and hence may end up setting the inode up with stale metadata.

Fix is to use nfs_refresh_inode() instead of nfs_update_inode().

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

linux-2.6.27-008-fix_nfsroot_section_conflict.dif:

From: Adrian Bunk <bunk@kernel.org>

Date: Fri, 25 Jul 2008 02:55:49 +0300

fix fs/nfs/nfsroot.c compilation

This patch fixes the following compile error caused by commit f9247273cb69ba101877e946d2d83044409cc8c5 (UFS: add const to parser token tabl):

<-- snip -->

... CC fs/nfs/nfsroot.o /home/bunk/linux/kernel-2.6/git/linux-2.6/fs/nfs/nfsroot.c:130: error: tokens causes a section type conflict make[3]: *** [fs/nfs/nfsroot.o] Error 1

<-- snip -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>

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

linux-2.6.27-009-fix_nfs_do_clone_mount_return_val.dif:

From: \"Denis V. Lunev\" <den@openvz.org>

Date: Thu, 31 Jul 2008 09:38:55 +0400

nfs: ERR_PTR is expected on failure from nfs_do_clone_mount

Replace NULL with ERR_PTR(-EINVAL).

Signed-off-by: Denis V. Lunev <den@openvz.org>

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

linux-2.6.27-010-dont_try_module_get_in_xprt_register_transport.dif:

From: \"Denis V. Lunev\" <den@openvz.org>

Date: Thu, 31 Jul 2008 09:53:56 +0400

sunrpc: do not pin sunrpc module in the memory

Basically, try_module_get here are pretty useless. Any other module using this API will pin sunrpc in memory due using exported symbols.

Signed-off-by: Denis V. Lunev <den@openvz.org>

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

linux-2.6.27-011-nfs_follow_mountpoint_fail_gracefully_if_server_insane.dif:

From: \"Denis V. Lunev\" <den@openvz.org>

Date: Mon, 11 Aug 2008 12:02:34 +0400

nfs: BUG_ON in nfs_follow_mountpoint

Unfortunately, BUG_ON(IS_ROOT(dentry)) can happen inside nfs_follow_mountpoint with NFS running Fedora 8 using a specific setup. https://bugzilla.redhat.com/show_bug.cgi?id=458622

So, the situation should be handled on NFS client gracefully.

Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Trond Myklebust <Trond.Myklebust@netapp.com> CC: J. Bruce Fields <bfields@fieldses.org>

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

linux-2.6.27-012-remove_obsolete_nfs_flock_comment.dif:

From: J. Bruce Fields <bfields@citi.umich.edu>

Date: Thu, 14 Aug 2008 18:32:55 -0400

nfs: remove an obsolete nfs_flock comment

We *do* now allow bsd flocks over nfs.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

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

linux-2.6.27-013-ensure_we_initialise_fattrs_in_getacl.dif:

From: Jeff Layton <jlayton@redhat.com>

Date: Mon, 18 Aug 2008 09:17:58 -0400

NFS: missing nfs_fattr_init in nfs3_proc_getacl and nfs3_proc_setacls (resend #2)

The fattrs used in the NFSv3 getacl/setacl calls are not being properly initialized. This occasionally causes nfs_update_inode to fall into NFSv4 specific codepaths when handling post-op attrs from these calls.

Thanks to Cai Qian for noticing the spurious NFSv4 messages in debug output from a v3 mount...

Signed-off-by: Jeff Layton <jlayton@redhat.com>

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

linux-2.6.27-014-nfs_authenticated_deep_mounting.dif:

From: EG Keizer <keie@few.vu.nl>

Date: Tue, 19 Aug 2008 16:34:36 -0400

nfs: authenticated deep mounting

Allow mount to do authenticated mounts below the root of the exported tree. The wording in RFC 2623, sec 2.3.2. allows fsinfo with UNIX authentication on the root of the export. Mounts are not always done on the root of the exported tree. Especially autoumounts often mount below the root of the exported tree. Some server implementations (justly) require full authentication for the so-called deep mounts. The old code used AUTH_SYS only. This caused deep mounts to fail on systems requiring stronger authentication.. The client should try both authentication types and use the first one that succeeds. This method was already partially implemented. This patch completes the implementation for NFS2 and NFS3. This patch was developed to allow Debian systems to automount home directories on Solaris servers with krb5 authentication.

Tested on kernel 2.6.24-etchnhalf.1

Signed-off-by: E.G. Keizer <keie@few.vu.nl>

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

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

linux-2.6.27-015-break_up_nfs_follow_referral.dif:

From: \"J. Bruce Fields\" <bfields@citi.umich.edu>

Date: Wed, 20 Aug 2008 16:10:20 -0400

nfs: break up nfs_follow_referral

This function is a little longer and more deeply nested than necessary.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

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

linux-2.6.27-016-fix_for_allergy_in_nfs_follow_referral.dif:

From: \"J. Bruce Fields\" <bfields@citi.umich.edu>

Date: Wed, 20 Aug 2008 16:10:21 -0400

nfs: replace while loop by for loops in nfs_follow_referral

Whoever wrote this had a bizarre allergy to for loops.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

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

linux-2.6.27-017-make_nfs_set_port_static_inline.dif:

From: \"J. Bruce Fields\" <bfields@citi.umich.edu>

Date: Wed, 20 Aug 2008 16:10:22 -0400

nfs: prepare to share nfs_set_port

We plan to use this function elsewhere.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

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

linux-2.6.27-018-fs_locations_assumes_nul_terminated_strings.dif:

From: \"J. Bruce Fields\" <bfields@citi.umich.edu>

Date: Wed, 20 Aug 2008 16:10:23 -0400

nfs: Fix misparsing of nfsv4 fs_locations attribute

The code incorrectly assumes here that the server name (or ip address) is null-terminated. This can cause referrals to fail in some cases.

Also support ipv6 addresses.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

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

linux-2.6.27-019-save_8_padding_bytes_in_nfs_fattr.dif:

From: Richard Kennedy <richard@rsk.demon.co.uk>

Date: Tue, 26 Aug 2008 16:23:20 +0100

NFS: remove 8 bytes of padding from struct nfs_fattr on 64 bit builds

remove 8 bytes of padding from struct nfs_fattr on 64 bit builds

This also removes padding from several nfs structures, including 16 bytes from nfs4_opendata, nfs4_createdata,nfs3_createdata & 8 bytes from nfs_read_data,nfs_write_data,nfs_removeres,nfs4_closedata

This also reduces the reported stack usage of many nfs functions (30+).

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk> ----

This patch is against the latest git 2.6.27-rc4. I've built & run this on my AMD64 desktop, & successfully run _simple_ tests with a 64 bit client => 32 bit server & 32 bit client to 64 bit server.

On fedora with gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8) checkpatch reports 33 functions with reduced stack usage. e.g. __nfs_revalidate_inode [nfs] 216 => 200 _nfs4_proc_access [nfs] 304 => 288 _nfs4_proc_link [nfs] 536 => 504 _nfs4_proc_remove [nfs] 304 => 288 _nfs4_proc_rename [nfs] 584 => 552 nfs3_proc_access [nfs] 272 => 256 nfs3_proc_getacl [nfs] 384 => 368 nfs3_proc_link [nfs] 496 => 464 etc I can supply the complete list if anyone is interested.

regards Richard

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

linux-2.6.27-020-fix_clientid_size.dif:

From: Chuck Lever <chuck.lever@oracle.com>

Date: Thu, 25 Sep 2008 11:57:12 -0400

NFS: SETCLIENTID truncates client ID and netid

The sc_name field is currently 56 bytes long. This is not large enough to hold a pair of IPv6 addresses, the authentication type, the protocol name, and a uniquifier number. The maximum possible size of the name string using IPv6 addresses is just under 110 bytes, so I increased the size of the sc_name field to accomodate this maximum.

In addition, the strings in the nfs4_setclientid structure are constructed with scnprintf(), which wants to terminate its output with '\0'. The sc_netid field was large enough only for a three byte netid string and a '\0' so inet6 netids were being truncated. Perhaps we don't need the overhead of scnprintf() to do a simple string copy, but I fixed this by increasing the size of the buffer by one byte.

Since all three of the string buffers in nfs4_setclientid are constructed with scnprintf(), I increased the size of all three by one byte to document the requirement, although I don't think either the universal address field or the name field will be so small that these strings get truncated in this way.

The size of the Linux client's client ID on the wire will be larger than before. RFC 3530 suggests the size limit for client IDs is 1024, and we are still well below that.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

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

linux-2.6.27-021-udp_connect.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 15 Jul 2008 17:58:17 -0400

SUNRPC: Add connected sockets for UDP

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

linux-2.6.27-022-cleanup_rpc_exit.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 15 Jul 2008 17:58:18 -0400

SUNRPC: Ensure that rpc_exit() always wakes up a sleeping task

Make rpc_exit() non-inline, and ensure that it always wakes up a task that has been queued.

Kill off the now unused rpc_wake_up_task().

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

linux-2.6.27-023-cleanup_rpc_set_active.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 15 Jul 2008 17:58:20 -0400

SUNRPC: Move remaining RPC client related task initialisation into clnt.c

Now that rpc_run_task() is the sole entry point for RPC calls, we can move the remaining rpc_client-related initialisation of struct rpc_task from sched.c into clnt.c.

Also move rpc_killall_tasks() into the same file, since that too is relative to the rpc_clnt.

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

linux-2.6.27-024-cleanup_rpc_bind_cred.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Tue, 15 Jul 2008 17:58:22 -0400

SUNRPC: Clean up of rpc_bindcred()

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

linux-2.6.27-025-constify_rpc_clnt_char_pointers.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 15 Aug 2008 17:02:38 -0400

SUNRPC: constify rpc_clnt fields cl_server and cl_protname

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

linux-2.6.27-026-constify_rpc_program_name.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 15 Aug 2008 17:02:38 -0400

SUNRPC: constify rpc_program->name

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

linux-2.6.27-027-constify_rpc_prog_info.dif:

From: Trond Myklebust <Trond.Myklebust@netapp.com>

Date: Fri, 15 Aug 2008 17:02:39 -0400

SUNRPC: constify the rpc_program and procedure info

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

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[TXT]linux-2.6.27-001-fix..>2008-09-25 16:12 1.6K 
[TXT]linux-2.6.27-002-cle..>2008-09-16 22:23 4.8K 
[TXT]linux-2.6.27-003-str..>2008-09-16 22:23 1.7K 
[TXT]linux-2.6.27-004-don..>2008-09-16 22:23 1.8K 
[TXT]linux-2.6.27-005-loo..>2008-09-16 22:23 2.7K 
[TXT]linux-2.6.27-006-fix..>2008-09-25 16:12 1.9K 
[TXT]linux-2.6.27-007-fix..>2008-09-25 16:12 1.4K 
[TXT]linux-2.6.27-008-fix..>2008-09-25 16:12 1.0K 
[TXT]linux-2.6.27-009-fix..>2008-09-25 16:12 809  
[TXT]linux-2.6.27-010-don..>2008-09-25 16:12 1.3K 
[TXT]linux-2.6.27-011-nfs..>2008-09-25 16:12 1.1K 
[TXT]linux-2.6.27-012-rem..>2008-09-25 16:12 1.0K 
[TXT]linux-2.6.27-013-ens..>2008-09-25 16:12 1.4K 
[TXT]linux-2.6.27-014-nfs..>2008-09-25 16:12 3.7K 
[TXT]linux-2.6.27-015-bre..>2008-09-25 16:12 3.6K 
[TXT]linux-2.6.27-016-fix..>2008-09-25 16:12 2.1K 
[TXT]linux-2.6.27-017-mak..>2008-09-25 16:12 1.9K 
[TXT]linux-2.6.27-018-fs_..>2008-09-25 16:12 4.1K 
[TXT]linux-2.6.27-019-sav..>2008-09-25 16:12 1.8K 
[TXT]linux-2.6.27-020-fix..>2008-09-25 16:12 2.3K 
[TXT]linux-2.6.27-021-udp..>2008-07-15 21:59 7.0K 
[TXT]linux-2.6.27-022-cle..>2008-07-15 21:59 3.0K 
[TXT]linux-2.6.27-023-cle..>2008-07-15 21:59 7.9K 
[TXT]linux-2.6.27-024-cle..>2008-07-15 21:59 4.5K 
[TXT]linux-2.6.27-025-con..>2008-09-16 22:23 2.0K 
[TXT]linux-2.6.27-026-con..>2008-09-16 22:23 1.3K 
[TXT]linux-2.6.27-027-con..>2008-09-25 16:12 23K 
[   ]series 2008-09-25 16:12 1.4K 

Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16 mod_perl/2.0.11 Perl/v5.16.3 Server at linux-nfs.org Port 80