aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-05-22NFSv4.1 Just use nfs_put_client in filelayout releaseAndy Adamson1-10/+2
Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-22NFSv4.1 fix null state reference in filelayout_async_handle_errorAndy Adamson1-3/+3
Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-22NFSv4.1: Fix a bad reference count issue in the pNFS commit codeTrond Myklebust1-0/+1
filelayout_scan_commit_lists needs to bump the reference count on the struct nfs_page just like nfs_scan_commit_list(). Reported-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-21Merge branch 'bugfixes' into nfs-for-nextTrond Myklebust3-11/+10
2012-05-19NFSv4.1 resend LAYOUTGET on data server invalid layout errorsAndy Adamson4-4/+39
The "invalid layout" class of errors is handled by destroying the layout and getting a new layout from the server. Currently, the layout must be destroyed before a new layout can be obtained. This means that all references (e.g.lsegs) to the "to be destroyed" layout header must be dropped before it can be destroyed. This in turn means waiting for all in flight RPC's using the old layout as well as draining the data server session slot table wait queue. Set the NFS_LAYOUT_INVALID flag to redirect I/O to the MDS while waiting for the old layout to be destroyed. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 dereference a disconnected data server client recordAndy Adamson3-0/+24
When the last DS io is processed, the data server client record will be freed. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 ref count nfs_client across filelayout data server ioAndy Adamson1-5/+21
Prepare to put a dis-connected DS client record. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 send layoutreturn to fence disconnected data serverAndy Adamson2-0/+3
Let the MDS know that you are redirecting I/O from pNFS to MDS. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 wake up all tasks on un-connected DS slot table waitqAndy Adamson1-0/+2
The DS has a connection error (invalid deviceid). Drain the fore channel slot table waitq. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 Check invalid deviceid upon slot table waitq wakeupAndy Adamson1-0/+20
Tasks sleeping on the slot table waitq wake to the rpc_prepare_task state. Reset the task for io through the MDS if the deviceid is invalid. The reset functions put the io pages through the pageio layer which has the advantage of re-coalescing which allows for the MDS and DS having different r/wsizes. Exit the awakened task without executing the rpc_call_done routine. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 remove nfs4_reset_write and nfs4_reset_readAndy Adamson2-37/+0
Replaced by filelayout_reset_write and filelayout_reset_read Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1: mark deviceid invalid on filelayout DS connection errorsAndy Adamson4-35/+108
This prevents the use of any layout for i/o that references the deviceid. I/O is redirected through the MDS. Redirect the unhandled failed I/O to the MDS without marking either the layout or the deviceid invalid. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 data server timeo and retrans module parametersAndy Adamson4-11/+30
Set the recovery parameters for data servers. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 set RPC_TASK_SOFTCONN for filelayout DS RPC callsAndy Adamson4-16/+19
RPC_TASK_SOFTCONN returns connection errors to the caller which allows the pNFS file layout to quickly try the MDS or perhaps another DS. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1 cleanup filelayout invalid layout handlingAndy Adamson1-22/+6
The invalid layout bits are should only be used to block LAYOUTGETs. Do not invalidate a layout on deviceid invalidation. Do not invalidate a layout on un-handled READ, WRITE, COMMIT errors. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19NFSv4.1: cleanup filelayout invalid deviceid handlingAndy Adamson3-40/+28
Move the invalid deviceid test into nfs4_fl_prepare_ds, called by the filelayout read, write, and commit routines. NFS4_DEVICE_ID_NEG_ENTRY is no longer needed. Remove redundant printk's - filelayout_mark_devid_invalid prints a KERN_WARNING. An invalid device prevents pNFS io. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-19Fixed goto readability in nfs_update_inode.Matthew Treinish1-17/+16
Simplified error gotos to make it slightly easier to read, it doesn't affect the functionality of the routine. Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-16NFS: fix unsigned comparison in nfs4_create_sec_clientBenny Halevy1-1/+1
fs/nfs/nfs4namespace.c: In function ‘nfs4_create_sec_client’: fs/nfs/nfs4namespace.c:171:2: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] Introduced by commit 72de53ec4bca39c26709122a8f78bfefe7b6bca4 "NFS: Do secinfo as part of lookup" Signed-off-by: Benny Halevy <bhalevy@tonian.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-16NFS: Fix a compile issue when CONFIG_NFS_FSCACHE was undefinedTrond Myklebust2-6/+8
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: kmalloc() doesn't return an ERR_PTR()Dan Carpenter1-7/+3
Obviously we should check for NULL here instead of IS_ERR(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@vger.kernel.org [3.4] Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Turn v3 on by defaultBryan Schumaker1-0/+1
Most users will use NFS v3 or possibly v4 so this makes it easier for them. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Make v2 configurableBryan Schumaker3-4/+27
With this patch NFS v2 can be disabled during Kconfig. I default the option to "y" to match the current behavior. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Create an NFS v3 stat_to_errno()Bryan Schumaker3-20/+87
In theory, NFS v3 can have different error versions than NFS v2. v4 is already using its own nfs4_stat_to_errno() to map error codes, so rather than create something in the generic client for v2 and v3 to share I instead give v3 its own function. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Pass mntfh as part of the nfs_mount_info structureBryan Schumaker1-76/+31
This allows me to use the filehandle allocated in nfs_fs_mount() for nfs v4 mounts instead of allocating a new one. Rather than change nfs4_mount() to look almost exactly like nfs_fs_mount(), I instead remove the function. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Allocate parsed mount data directly to the nfs_mount_info structureBryan Schumaker1-9/+7
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Create a single nfs_validate_mount_data() functionBryan Schumaker1-6/+30
This new function chooses between the v2/3 parser and the v4 parser by filesystem type. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Create a single function for text mount dataBryan Schumaker2-81/+71
The v2/3 and v4 cases were very similar, with just a few parameters changed. This makes it easy to share code. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Create a new nfs_try_mount()Bryan Schumaker1-19/+27
This function returns the same same return type as nfs4_try_mount() so they two can be more easily substituted. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Let mount data parsing set the NFS versionBryan Schumaker1-4/+3
This field is unconditionally set while parsing mount data, so there is no need to fill it in here. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Use nfs_fs_mount_common() for remote referral mountsBryan Schumaker1-76/+13
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Use nfs_fs_mount_common() for xdev mountsBryan Schumaker1-67/+29
At this point, there are only a few small differences between these two functions. I can set a few function pointers in the nfs_mount_info struct to get around these differences. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Create a common xdev_mount() functionBryan Schumaker1-90/+32
The only difference between nfs_xdev_mount() and nfs4_xdev_mount() is the clone_super() function called to clone the super block. I can combine these two functions by using the fill_super field in the mount_info structure. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Create a common fs_mount() functionBryan Schumaker1-109/+76
The nfs4_remote_mount() function was only slightly different from the nfs_fs_mount() function used by the generic client. I created a new nfs_mount_info structure to set different parameters to help combine these functions. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Remove NFS4_MOUNT_UNSHAREDBryan Schumaker1-3/+3
This flag is numerically equivalent to NFS_MOUNT_UNSHARED, so I can remove it to make collapsing functions more straightforward. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Don't pass mount data to nfs_fscache_get_super_cookie()Bryan Schumaker3-21/+29
I intend on creating a single nfs_fs_mount() function used by all our mount paths. To avoid checking between new mounts and clone mounts, I instead pass both structures to a new function in super.c that finds the cache key and then looks up the super cookie. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Create a single nfs_get_root()Bryan Schumaker3-87/+30
This patch splits out the NFS v4 specific functionality of nfs4_get_root() into its own rpc_op called by the generic client, and leaves nfs4_proc_get_rootfh() as its own stand alone function. This also allows me to change nfs4_remote_mount(), nfs4_xdev_mount() and nfs4_remote_referral_mount() to use the generic client's nfs_get_root() function. Later patches in this series will collapse these functions into one common function, so using the same get_root() function everywhere simplifies future changes. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-14NFS: Rename nfs4_proc_get_root()Bryan Schumaker3-4/+5
This function is really getting the root filehandle and not the root dentry of the filesystem. I also removed the rpc_ops lookup from nfs4_get_rootfh() under the assumption that if we reach this function then we already know we are using NFS v4. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-10vfs: make it possible to access the dentry hash/len as one 64-bit entryLinus Torvalds4-10/+4
This allows comparing hash and len in one operation on 64-bit architectures. Right now only __d_lookup_rcu() takes advantage of this, since that is the case we care most about. The use of anonymous struct/unions hides the alternate 64-bit approach from most users, the exception being a few cases where we initialize a 'struct qstr' with a static initializer. This makes the problematic cases use a new QSTR_INIT() helper function for that (but initializing just the name pointer with a "{ .name = xyzzy }" initializer remains valid, as does just copying another qstr structure). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-09NFS: Clean up - Simplify reference counting in fs/nfs/direct.cTrond Myklebust1-11/+4
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
2012-05-09NFS: Clean up - Rename nfs_unlock_request and nfs_unlock_request_dont_releaseTrond Myklebust3-16/+17
Function rename to ensure that the functionality of nfs_unlock_request() mirrors that of nfs_lock_request(). Then let nfs_unlock_and_release_request() do the work of what used to be called nfs_unlock_request()... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
2012-05-09NFS: Clean up - simplify nfs_lock_request()Trond Myklebust2-5/+7
We only have two places where we need to grab a reference when trying to lock the nfs_page. We're better off making that explicit. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
2012-05-09NFS: nfs_set_page_writeback no longer needs to reference the pageTrond Myklebust1-8/+3
We now hold a reference to the nfs_page across the calls to nfs_set_page_writeback and nfs_end_page_writeback, and that means we already have a reference to the struct page. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
2012-05-09NFS: Prevent a deadlock in the new writeback codeTrond Myklebust2-4/+14
We have to unlock the nfs_page before we call nfs_end_page_writeback to avoid races with functions that expect the page to be unlocked when PG_locked and PG_writeback are not set. The problem is that nfs_unlock_request also releases the nfs_page, causing a deadlock if the release of the nfs_open_context triggers an iput() while the PG_writeback flag is still set... The solution is to separate the unlocking and release of the nfs_page, so that we can do the former before nfs_end_page_writeback and the latter after. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
2012-05-08NFSv4: nfs_client_return_marked_delegations can't flush dataTrond Myklebust1-3/+7
Since even filemap_flush() needs to lock pages that are dirty, we cannot risk calling it from the state manager context. Therefore, we need to move the call to filemap_flush() to nfs_async_inode_return_delegation(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-08NFS: nfs_inode_return_delegation() should always flush dirty dataTrond Myklebust2-1/+6
The assumption is that if you are in a situation where you need to return the delegation, then you should probably stop caching the data anyway. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-08NFS: Don't do a full flush to disk on close() if we hold a delegationTrond Myklebust1-0/+7
If we hold a delegation then we know that it should be safe to continue to cache the data beyond the close(). However since the process that wrote the data may die after close(), we may still want to send the data to server before those RPCSEC_GSS credentials expire. We therefore compromise by starting writeback to the server, but don't wait for completion. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-05-06vfs: Rename end_writeback() to clear_inode()Jan Kara1-2/+2
After we moved inode_sync_wait() from end_writeback() it doesn't make sense to call the function end_writeback() anymore. Rename it to clear_inode() which well says what the function really does - set I_CLEAR flag. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
2012-05-04NFS: Fix sparse warningsTrond Myklebust3-3/+3
Fix the following sparse warnings: fs/nfs/direct.c:221:6: warning: symbol 'nfs_direct_readpage_release' was not declared. Should it be static? fs/nfs/read.c:38:43: warning: non-ANSI function declaration of function 'nfs_readhdr_alloc' fs/nfs/objlayout/objio_osd.c:214:5: warning: symbol '__alloc_objio_seg' was not declared. Should it be static? Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com> Cc: Boaz Harrosh <bharrosh@panasas.com>
2012-05-04NFS: Fix O_DIRECT compile warningsTrond Myklebust1-4/+4
Fix the following compile warnings: fs/nfs/direct.c: In function 'nfs_direct_read_schedule_segment': fs/nfs/direct.c:325:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:325:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:325:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:352:27: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c: In function 'nfs_direct_write_schedule_segment': fs/nfs/direct.c:622:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:622:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:622:11: warning: comparison of distinct pointer types lacks a cast [enabled by default] fs/nfs/direct.c:650:27: warning: comparison of distinct pointer types lacks a cast [enabled by default] Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
2012-05-01NFS: Adapt readdirplus to application usage patternsTrond Myklebust2-4/+31
While the use of READDIRPLUS is significantly more efficient than READDIR followed by many LOOKUP calls, it is still less efficient than just READDIR if the attributes are not required. This patch tracks when lookups are attempted on the directory, and uses that information to selectively disable READDIRPLUS on that directory. The first 'readdir' call is always served using READDIRPLUS. Subsequent calls only use READDIRPLUS if there was a successful lookup or revalidation on a child in the mean time. Credit for the original idea should go to Neil Brown. See: http://www.spinics.net/lists/linux-nfs/msg19996.html However, the implementation in this patch differs from Neil's in that it focuses on tracking lookups rather than calls to stat(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Neil Brown <neilb@suse.de>