aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-12-06NFSv4.1: Ensure that the client tracks the server target_highest_slotidTrond Myklebust6-9/+36
Dynamic slot allocation in NFSv4.1 depends on the client being able to track the server's target value for the highest slotid in the slot table. See the reference in Section 2.10.6.1 of RFC5661. To avoid ordering problems in the case where 2 SEQUENCE replies contain conflicting updates to this target value, we also introduce a generation counter, to track whether or not an RPC containing a SEQUENCE operation was launched before or after the last update. Also rename the nfs4_slot_table target_max_slots field to 'target_highest_slotid' to avoid confusion with a slot table size or number of slots. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-26NFSv4.1: Clean up nfs4_free_slotTrond Myklebust1-5/+7
Change the argument to take the pointer to the slot, instead of just the slotid. We know that the new value of highest_used_slot must be less than the current value. No need to scan the whole table. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-26NFSv4.1: Simplify slot allocationTrond Myklebust1-15/+14
Clean up the NFSv4.1 slot allocation by replacing nfs_find_slot() with a function nfs_alloc_slot() that returns a pointer to the nfs4_slot instead of an offset into the slot table. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-26NFSv4.1: Simplify struct nfs4_sequence_args tooTrond Myklebust3-16/+14
Replace the session pointer + slotid with a pointer to the allocated slot. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-26NFSv4.1: Label each entry in the session slot tables with its slot numberTrond Myklebust3-6/+9
Instead of doing slot table pointer gymnastics every time we want to know which slot we're using. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-26NFSv4.1: Shrink struct nfs4_sequence_res by moving the session pointerTrond Myklebust6-16/+33
Move the session pointer into the slot table, then have struct nfs4_slot point to that slot table. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-25nfs: Fix wrong slab cache in nfs_commit_mempoolYanchuan Nian1-1/+1
The slab cache in nfs_commit_mempool is wrong, and I think it is just a slip. I tested it on a x86-32 machine, the size of nfs_write_header is 544, and the size of nfs_commit_data is 408, so it works fine. It is also true that sizeof(struct nfs_write_header) > sizeof(struct nfs_commit_data) on other platforms in my opinoin. Just fix it. Signed-off-by: Yanchuan Nian <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFS: Reduce stack use in encode_exchange_id()Jim Rees1-3/+5
encode_exchange_id() uses more stack space than necessary, giving a compile time warning. Reduce the size of the static buffer for implementation name. Signed-off-by: Jim Rees <[email protected]> Reviewed-by: "Adamson, Dros" <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFSv4: Fix a compile time warning when #undef CONFIG_NFS_V4_1Trond Myklebust1-1/+1
The function nfs4_get_machine_cred_locked is used by NFSv4.0 routines too. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFSv4.1: Shrink struct nfs4_sequence_res by moving sr_renewal_timeTrond Myklebust2-7/+10
Store the renewal time inside the session slot instead. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFSv4.1: clean up nfs4_recall_slot to use nfs4_alloc_slotsTrond Myklebust3-3/+4
Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFSv4.1: nfs4_alloc_slots doesn't need zeroingTrond Myklebust1-1/+1
All that memory is going to be initialised to non-zero by nfs4_add_and_init_slots anyway. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFSv4.1: We must bump the clientid sequence number after CREATE_SESSIONTrond Myklebust1-2/+1
We must always bump the clientid sequence number after a successful call to CREATE_SESSION on the server. The result of nfs4_verify_channel_attrs() is irrelevant to that requirement. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFSv4.1: Adjust CREATE_SESSION arguments when mounting a new filesystemTrond Myklebust1-0/+13
If we're mounting a new filesystem, ensure that the session has negotiated large enough request and reply sizes to match the wsize and rsize mount arguments. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFSv4.1: Don't confuse CREATE_SESSION arguments and resultsTrond Myklebust2-13/+20
Don't store the target request and response sizes in the same variables used to store the server's replies to those targets. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-21NFSv4.1: Handle session reset and bind_conn_to_session before lease checkTrond Myklebust1-9/+8
We can't send a SEQUENCE op unless the session is OK, so it is pointless to handle the CHECK_LEASE state before we've dealt with SESSION_RESET and BIND_CONN_TO_SESSION. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-20NFS: Add sequence_priviliged_ops for nfs4_proc_sequence()Bryan Schumaker1-4/+17
If I mount an NFS v4.1 server to a single client multiple times and then run xfstests over each mountpoint I usually get the client into a state where recovery deadlocks. The server informs the client of a cb_path_down sequence error, the client then does a bind_connection_to_session and checks the status of the lease. I found that bind_connection_to_session sets the NFS4_SESSION_DRAINING flag on the client, but this flag is never unset before nfs4_check_lease() reaches nfs4_proc_sequence(). This causes the client to deadlock, halting all NFS activity to the server. nfs4_proc_sequence() is only called by the state manager, so I can change it to run in privileged mode to bypass the NFS4_SESSION_DRAINING check and avoid the deadlock. Signed-off-by: Bryan Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]> Cc: [email protected]
2012-11-08SUNRPC: Fix validity issues with rpc_pipefs sb->s_fs_infoTrond Myklebust1-1/+6
rpc_kill_sb() must defer calling put_net() until after the notifier has been called, since most (all?) of the notifier callbacks assume that sb->s_fs_info points to a valid net namespace. It also must not call put_net() if the call to rpc_fill_super was unsuccessful. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=48421 Signed-off-by: Trond Myklebust <[email protected]> Cc: Stanislav Kinsbursky <[email protected]> Cc: [email protected] [>= v3.4]
2012-11-07Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixesLinus Torvalds6-38/+43
Pull gfs2 fixes from Steven Whitehouse: "Here are a number of GFS2 bug fixes. There are three from Andy Price which fix various issues spotted by automated code analysis. There are two from Lukas Czerner fixing my mistaken assumptions as to how FITRIM should work. Finally Ben Marzinski has fixed a bug relating to mmap and atime and also a bug relating to a locking issue in the transaction code." * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes: GFS2: Test bufdata with buffer locked and gfs2_log_lock held GFS2: Don't call file_accessed() with a shared glock GFS2: Fix FITRIM argument handling GFS2: Require user to provide argument for FITRIM GFS2: Clean up some unused assignments GFS2: Fix possible null pointer deref in gfs2_rs_alloc GFS2: Fix an unchecked error from gfs2_rs_alloc
2012-11-07Merge branch 'hwmon-for-linus' of ↵Linus Torvalds7-6/+7
git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging Pull hwmon fixes from Jean Delvare. * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: Fix chip feature table headers hwmon: (w83627ehf) Force initial bank selection
2012-11-07GFS2: Test bufdata with buffer locked and gfs2_log_lock heldBenjamin Marzinski2-12/+10
In gfs2_trans_add_bh(), gfs2 was testing if a there was a bd attached to the buffer without having the gfs2_log_lock held. It was then assuming it would stay attached for the rest of the function. However, without either the log lock being held of the buffer locked, __gfs2_ail_flush() could detach bd at any time. This patch moves the locking before the test. If there isn't a bd already attached, gfs2 can safely allocate one and attach it before locking. There is no way that the newly allocated bd could be on the ail list, and thus no way for __gfs2_ail_flush() to detach it. Signed-off-by: Benjamin Marzinski <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2012-11-07GFS2: Don't call file_accessed() with a shared glockBenjamin Marzinski2-8/+7
file_accessed() was being called by gfs2_mmap() with a shared glock. If it needed to update the atime, it was crashing because it dirtied the inode in gfs2_dirty_inode() without holding an exclusive lock. gfs2_dirty_inode() checked if the caller was already holding a glock, but it didn't make sure that the glock was in the exclusive state. Now, instead of calling file_accessed() while holding the shared lock in gfs2_mmap(), file_accessed() is called after grabbing and releasing the glock to update the inode. If file_accessed() needs to update the atime, it will grab an exclusive lock in gfs2_dirty_inode(). gfs2_dirty_inode() now also checks to make sure that if the calling process has already locked the glock, it has an exclusive lock. Signed-off-by: Benjamin Marzinski <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2012-11-07GFS2: Fix FITRIM argument handlingLukas Czerner1-3/+17
Currently implementation in gfs2 uses FITRIM arguments as it were in file system blocks units which is wrong. The FITRIM arguments (fstrim_range.start, fstrim_range.len and fstrim_range.minlen) are actually in bytes. Moreover, check for start argument beyond the end of file system, len argument being smaller than file system block and minlen argument being bigger than biggest resource group were missing. This commit converts the code to convert FITRIM argument to file system blocks and also adds appropriate checks mentioned above. All the problems were recognised by xfstests 251 and 260. Signed-off-by: Lukas Czerner <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2012-11-07GFS2: Require user to provide argument for FITRIMLukas Czerner1-6/+2
When the fstrim_range argument is not provided by user in FITRIM ioctl we should just return EFAULT and not promoting bad behaviour by filling the structure in kernel. Let the user deal with it. Signed-off-by: Lukas Czerner <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2012-11-07GFS2: Clean up some unused assignmentsAndrew Price2-4/+0
Cleans up two cases where variables were assigned values but then never used again. Signed-off-by: Andrew Price <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2012-11-07GFS2: Fix possible null pointer deref in gfs2_rs_allocAndrew Price1-3/+2
Despite the return value from kmem_cache_zalloc() being checked, the error wasn't being returned until after a possible null pointer dereference. This patch returns the error immediately, allowing the removal of the error variable. Signed-off-by: Andrew Price <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2012-11-07GFS2: Fix an unchecked error from gfs2_rs_allocAndrew Price1-2/+5
Check the return value of gfs2_rs_alloc(ip) and avoid a possible null pointer dereference. Signed-off-by: Andrew Price <[email protected]> Signed-off-by: Steven Whitehouse <[email protected]>
2012-11-07Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds2-15/+31
Pull drm fixes from Dave Airlie: "A single radeon typo fix for a regressions and two fixes for a regression in the open helper address space stuff." * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm/radeon: fix typo in evergreen_mc_resume() drm: set dev_mapping before calling drm_open_helper drm: restore open_count if drm_setup fails
2012-11-07Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds7-29/+21
Pull arm fixes from Russell King: "Not much here again. The two most notable things here are the sched_clock() fix, which was causing problems with the scheduling of threaded IRQs after a suspend event, and the vfp fix, which afaik has only been seen on some older OMAP boards. Nevertheless, both are fairly important fixes." * 'fixes' of git://git.linaro.org/people/rmk/linux-arm: ARM: 7569/1: mm: uninitialized warning corrections ARM: 7567/1: io: avoid GCC's offsettable addressing modes for halfword accesses ARM: 7566/1: vfp: fix save and restore when running on pre-VFPv3 and CONFIG_VFPv3 set ARM: 7565/1: sched: stop sched_clock() during suspend
2012-11-07drm/radeon: fix typo in evergreen_mc_resume()Alex Deucher1-1/+1
Add missing index that may have led us to enabling more crtcs than necessary. May also fix: https://bugs.freedesktop.org/show_bug.cgi?id=56139 Signed-off-by: Alex Deucher <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-11-07drm: set dev_mapping before calling drm_open_helperIlija Hadzic1-17/+30
Some drivers (specifically vmwgfx) look at dev_mapping in their open hook, so we have to set dev->dev_mapping earlier in the process. Reference: http://lists.freedesktop.org/archives/dri-devel/2012-October/029420.html Signed-off-by: Ilija Hadzic <[email protected]> Reported-by: Thomas Hellstrom <[email protected]> Cc: [email protected] Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-11-07drm: restore open_count if drm_setup failsIlija Hadzic1-1/+4
If drm_setup (called at first open) fails, the whole open call has failed, so we should not keep the open_count incremented. Signed-off-by: Ilija Hadzic <[email protected]> Cc: [email protected] Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-11-05hwmon: Fix chip feature table headersJean Delvare6-6/+6
These got broken by recent patches fixing checkpatch warnings in these drivers. The trick is that the patches themselves looked good, but the source files after applying them do not. That's why I am not a big fan of using tabs inside comments. Signed-off-by: Jean Delvare <[email protected]> Acked-by: Guenter Roeck <[email protected]>
2012-11-05hwmon: (w83627ehf) Force initial bank selectionJean Delvare1-0/+1
Don't assume bank 0 is selected at device probe time. This may not be the case. Force bank selection at first register access to guarantee that we read the right registers upon driver loading. Signed-off-by: Jean Delvare <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Cc: [email protected]
2012-11-04SUNRPC: Clean up rpc_bind_new_programTrond Myklebust1-10/+8
We can and should use the rpc_create_args and __rpc_clone_client() to change the program and version number on the resulting rpc_client. Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON from rpc_call_syncWeston Andros Adamson1-1/+6
Use WARN_ON_ONCE instead of calling BUG_ON and return -EINVAL when RPC_TASK_ASYNC flag is passed to rpc_call_sync. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON in rpc_release_taskWeston Andros Adamson1-1/+1
Replace BUG_ON() with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON in svc_delete_xprtWeston Andros Adamson1-1/+1
Replace BUG_ON() with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ONs checking RPC_IS_QUEUEDWeston Andros Adamson1-2/+6
Replace two BUG_ON() calls with WARN_ON_ONCE() and early returns. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON from __rpc_sleep_on_priorityWeston Andros Adamson1-1/+1
Replace BUG_ON() with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON in svc_registerWeston Andros Adamson1-1/+3
Instead of calling BUG_ON(), do a WARN_ON_ONCE() and return -EINVAL. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON from encode_rpcb_stringWeston Andros Adamson1-1/+4
Replace BUG_ON() with WARN_ON_ONCE() and truncate the encoded string if len > max. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON from bc_mallocWeston Andros Adamson1-2/+4
Replace BUG_ON() with WARN_ON_ONCE() and NULL return - the caller will handle this like a memory allocation failure. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON in xdr_shrink_bufheadWeston Andros Adamson1-1/+4
Replace bounds checking BUG_ON() with a WARN_ON_ONCE() and resetting the requested len to the max. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ONs checking RPCSVC_MAXPAGESWeston Andros Adamson2-2/+7
Replace two bounds checking BUG_ON() calls with WARN_ON_ONCE() and resetting the requested size to RPCSVC_MAXPAGES. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON in svc_xprt_receivedWeston Andros Adamson1-1/+3
Replace BUG_ON() with a WARN_ON_ONCE() and early return. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ONs from *_reclassify_socket*Weston Andros Adamson2-4/+9
Replace multiple BUG_ON() calls with WARN_ON_ONCE() and early return when sanity checking socket ownership (lock). The bind call will fail if the socket was unsuccessfully reclassified. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON from svc_pool_map_set_cpumaskWeston Andros Adamson1-1/+3
Replace BUG_ON() with a WARN() and early return. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove two BUG_ON assertsWeston Andros Adamson1-2/+2
Replace two BUG_ON() calls checking the RPC_BC_PA_IN_USE flag with WARN_ON_ONCE(). Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2012-11-04SUNRPC: remove BUG_ON in rpc_put_sb_netWeston Andros Adamson1-1/+1
Replace BUG_ON() with WARN_ON() - the condition is definitely a misuse of the API, but shouldn't cause a crash. Signed-off-by: Weston Andros Adamson <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>