summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-04-27staging/lustre/llite: prevent buffer overflow in fiemapBobi Jam
lov_fiemap() does not take consider its @vallen parameter, which is the max buffer size the caller can hold for the fiemap extents. This patch fixes this and limits the max mapped fiemap extent count to fit in the preallocted buffer. This patch also fixes a memory out of bound write issue when the fiemap call is only for detecting the number of existing extent. Signed-off-by: Bobi Jam <bobijam.xu@intel.com> Reviewed-on: http://review.whamcloud.com/9834 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4619 Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Patrick Farrell <paf@cray.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: Fix unsafe userspace access in many proc filesOleg Drokin
Apparently we are pretty bad about verifying our buffers passed from userspace. Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Reviewed-on: http://review.whamcloud.com/9059 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4563 Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: pass fsync() range through RPC/IO stackAndreas Dilger
The Linux VFS and Lustre OST_SYNC RPC are both capable of specifying fsync() on a sub-extent of the file {start, end} instead of the full file. This allows less than the full amount of data to be flushed, reducing or possibly eliminating the work needed before the syscall can return. However, the handling of sub-extent of the file for fsync was lost with the move to CLIO on the client and OSD API on the server. They were ignoring the passed {start, end} and using {0, OBD_OBJECT_EOF} instead. Return the ability to pass a sub-extent for fsync() from the client, to the specific stripes/OSTs that need the sync operation, and pass it down to the OSD. The ZFS OSD doesn't handle this yet, but there is room for improvement in a separate patch. Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-on: http://review.whamcloud.com/8626 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4388 Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: Always clamp cdls_delay between min and maxRyan Haasken
In libcfs_debug_vmsg2, cdls_delay is only clamped between the minimum and the maximum when it is increased by multiplying by the backoff factor. It is not clamped when it is decreased by dividing by the backoff factor. This allows it to achieve values less than the minimum, which allows a console message to be printed that should have been skipped. This patch moves the clamping outside of the else statement, ensuring that cdls_delay is always between the min and the max after the first time through libcfs_debug_vmsg2. Signed-off-by: Ryan Haasken <haasken@cray.com> Reviewed-on: http://review.whamcloud.com/9503 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4711 Reviewed-by: Chris Horn <hornc@cray.com> Reviewed-by: Ann Koehler <amk@cray.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/osc: Update inode timestamp for lockless IO as wellSwapnil Pimpale
Removed the checks for oi_lockless from osc_io_read_start() and osc_io_write_start(). This patch also removes the unnecessary call to cl_object_attr_get() in osc_io_write_start() before calling cl_object_attr_set() Signed-off-by: Swapnil Pimpale <spimpale@ddn.com> Reviewed-on: http://review.whamcloud.com/8797 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3868 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: remove assertion of spin_is_locked()Li Xi
spin_is_locked() is always false when the platform is uniprocessor and CONFIG_DEBUG_SPINLOCK is not enabled. This patch replaces its assertion by assert_spin_locked(). Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: James Simmons <uja.ornl@gmail.com> Reviewed-on: http://review.whamcloud.com/8144 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199 Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/llite: remove dead codeJohn L. Hammond
In llite remove unused declarations, parameters, types, and unused, get-only, or set-only structure members. Add static and const qualifiers to declarations where possible. Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-on: http://review.whamcloud.com/9767 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/mdc: use cl_max_mds_md to pack getattr RPCwang di
In some cases, cl_default_mds_easize might be zero, especially for MDC connected to non-MDT0, then mdc might pack getattr RPC with zero eadatasize. If client is trying to access remote striped directory with zero eadatasize, MDT will not return layout information of the striped direcotry, which will be mis-regarded as non-striped directory. So we should use cl_max_mds_easize if cl_default_mds_easize is zero. Signed-off-by: wang di <di.wang@intel.com> Reviewed-on: http://review.whamcloud.com/9862 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4847 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/clio: Solve a race in cl_lock_putJinshan Xiong
It's not atomic to check the last reference and state of cl_lock in cl_lock_put(). This can cause a problem that an using lock is freed, if the process is preempted between atomic_dec_and_test() and (lock->cll_state == CLS_FREEING). This problem can be solved by holding a refcount by coh_locks. In this case, it can be sure that if the lock refcount reaches zero, nobody else can have any chance to use it again. Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-on: http://review.whamcloud.com/9881 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4558 Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Lai Siyao <lai.siyao@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/lloop: avoid panic during blockdev_infoBob Glossman
Change the LL_IOC_LLOOP_INFO ioctl in the lustre lloop device driver to return an error instead of causing panics with LASSERT(). Signed-off-by: Bob Glossman <bob.glossman@intel.com> Reviewed-on: http://review.whamcloud.com/9888 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4863 Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/llite: Do not rate limit dirty page discard warningRyan Haasken
Messages which are printed by ll_dirty_page_discard_warn() should not be rate limited. If they are rate limited, some files which may be corrupted on client eviction will not be reported to the user. This patch changes the CWARN to a CDEBUG to disable console message rate limiting for this message. The dirty page discard warnings are already limited on a per-file basis by the function vvp_vmpage_error which calls ll_dirty_page_discard_warn only if the ccc_object's cob_discard_page_warned == 0. Signed-off-by: Ryan Haasken <haasken@cray.com> Reviewed-on: http://review.whamcloud.com/9752 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4799 Reviewed-by: Cory Spitz <spitzcor@cray.com> Reviewed-by: Ann Koehler <amk@cray.com> Reviewed-by: Chris Horn <hornc@cray.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/clio: replace semaphore with mutexDmitry Eremin
According https://www.kernel.org/doc/Documentation/mutex-design.txt: - the mutex subsystem is slightly faster and has better scalability for contended workloads. In terms of 'ops per CPU cycle', the semaphore kernel performed 551 ops/sec per 1% of CPU time used, while the mutex kernel performed 3825 ops/sec per 1% of CPU time used - it was 6.9 times more efficient. - there are no fastpath tradeoffs, the mutex fastpath is just as tight as the semaphore fastpath. On x86, the locking fastpath is 2 instructions. - 'struct mutex' semantics are well-defined and are enforced if CONFIG_DEBUG_MUTEXES is turned on. Semaphores on the other hand have virtually no debugging code or instrumentation. One more benefit of mutex is optimistic spinning. It try to spin for acquisition when there are no pending waiters and the lock owner is currently running on a (different) CPU. The rationale is that if the lock owner is running, it is likely to release the lock soon. This significantly reduce amount of context switches when locked region is small and we have high contention. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-on: http://review.whamcloud.com/9095 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4257 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: replace semaphores with mutexesDmitry Eremin
It's just optimization. The mutex subsystem is slightly faster and has better scalability for contended workloads. Remove the lustre_lock and it's accessor functions l_lock(), l_unlock(), l_lock_init(), and l_has_lock() since they have not been used by the code since Lustre 1.6. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-on: http://review.whamcloud.com/9294 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4588 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/libcfs: add CPU table functions for uniprocessorLi Xi
Some CPU table functions for uniprocessor architecture is missing. Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: James Simmons <uja.ornl@gmail.com> Reviewed-on: http://review.whamcloud.com/8873 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199 Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27Merge tag 'driver-core-3.15-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core fixes from Greg KH: "Here are some kernfs fixes for 3.15-rc3 that resolve some reported problems. Nothing huge, but all needed" * tag 'driver-core-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: s390/ccwgroup: Fix memory corruption kernfs: add back missing error check in kernfs_fop_mmap() kernfs: fix a subdir count leak
2014-04-27staging/lustre: remove lustre/include/ioctl.hJohn L. Hammond
Remove the nowhere included header lustre/include/ioctl.h. Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-on: http://review.whamcloud.com/9757 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675 Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/lnet: NI shutdown may loop foreverLiang Zhen
lnet_shutdown_lndnis() may enter endless loop if there is a busy NI, this is injected by LNet SMP improvements. It's fixed in this patch. Signed-off-by: Liang Zhen <liang.zhen@intel.com> Reviewed-on: http://review.whamcloud.com/9706 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4780 Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Bobi Jam <bobijam@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/libcfs: fix issues found by Klocwork Insight toolDmitry Eremin
sscanf format specification '%u' expects type 'unsigned int *' for 'u', but parameter 3 has a different type 'int*'. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-on: http://review.whamcloud.com/9400 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/mdc: fix issue found by Klocwork Insight toolDmitry Eremin
Pointer 'mod' checked for NULL at line 160 may be dereferenced at line 208. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-on: http://review.whamcloud.com/9387 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Fan Yong <fan.yong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/ldlm: fix NULL pointer dereferenceDmitry Eremin
Pointer '*exp' returned from call to function 'class_conn2export' at line 523 may be NULL and may be dereferenced at line 543. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-on: http://review.whamcloud.com/9323 ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: shrink lu_object_header by 8 bytes on x86_64Andreas Dilger
Locate the loh_flags and loh_ref fields together in lu_object_header to avoid holes and shrink the structure by 8 bytes. Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-on: http://review.whamcloud.com/9185 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3059 Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/llite: access layout version under a lockJinshan Xiong
We used to access layout version under the protection of ldlm lock, this introduces extra overhead for dlm lock matching. In this patch, lli_layout_lock is introduced to access the layout version. Also, when a layout lock is losing, we should tear down mmap of the correspoding inode to avoid stale data accessing in the future. This is part of technical verification of replication. Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-on: http://review.whamcloud.com/8689 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3254 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Bobi Jam <bobijam@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27stagaing/lustre: Improve statahead debug messagesChristopher J. Morrone
The statahead debug messages include the pid of the current process in their body. This is both redudant (because all lustre log messages contain the pid), and sometimes downright misleading. For instance the messages would say something like "stopping statahead thread 3446". One would probably think that 3446 is the pid of the process that is being stopped, but in fact it was the pid of the caller issuing the stop signal. We remove all superfluous pids from the messages. Next we have the ll_statahead_thread() and the ll_agl_thread() record their respective pids in their respective ptlrpc_thread structures. This allows to print the pid of the thread that we are trying to stop (which is actually useful info) from other threads, such as those calling ll_stop_statahead(). Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov> Reviewed-on: http://review.whamcloud.com/9360 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4624 Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Lai Siyao <lai.siyao@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/llite: Avoid statahead thread start/stop deadlocksChristopher J. Morrone
The statahead and statahead agl threads blindly set their thread state to SVC_RUNNING without checking the state first. If, for instance, another thread sets the state to SVC_STOPPING that stop signal will now have been lost. Deadlock ensues. We also partly improve the sai reference counting, because a race exists where the ll_stop_statahead thread can drop the default reference, and the statahead thread can exit and drop its reference as well. With no references on the sai, the final put will poison and free the buffer. The original do_statahead_enter() function may then continue to access the buffer after it is freed because it did not take a reference of its own. We add a local reference to address that. Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov> Reviewed-on: http://review.whamcloud.com/9358 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4624 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Fan Yong <fan.yong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: Limit reply buffer sizeBrian Behlendorf
When allocating a reply buffer for the striping information don't assume the unlikely worst case. Instead, assume the common case and size the buffer based on the observed default ea/cookie size. The default size is initialized to a single stripe and allowed to grow up to an entire page if needed. This means that for smallish filesystems (less than ~21 OSTs) where the worst case striping information can fit in a single page there is effectively no change. Only for larger filesystem will the default be less than the maximum. This has a number of advantages. * By limiting the default reply buffer size we avoid always vmalloc()'ing the buffer because it exceeds four pages in size and instead kmalloc() it. This prevents the client from thrashing on the global vmalloc() spin lock. * A reply buffer of exactly the right size (no larger) is allocated in the overflow case. These larger reply buffers are still unlikely to exceed the 16k limit where a vmalloc() will occur. * Saves memory in the common case. Wide striped files exceeded the default are expected to be the exception. The reason this patch works is because the ptlrpc layer is smart enough to reallocate the reply buffer when an overflow occurs. Therefore the client doesn't have to drop the incoming reply and send a new request with a larger reply buffer. It's also worth mentioning that the reply buffer always contains a significant amount of extra padding because they are rounded up to the nearest power of two. This means that even files striped wider than the default have a good chance of fitting in the allocated reply buffer. Also remove client eadatasize check in mdt xattr packing because as said above client can handle -EOVERFLOW. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Lai Siyao <lai.siyao@intel.com> Reviewed-on: http://review.whamcloud.com/6339 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3338 Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/lov: to not hold sub locks at initializationJinshan Xiong
Otherwise, it will cause deadlock because it essentially holds some sub locks and then to request others in an arbitrary order. Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-on: http://review.whamcloud.com/9152 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Bobi Jam <bobijam@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/llite: deadlock taking lli_trunc_sem during file writeBobi Jam
File write before io loop will take lli_trun_sem read semaphore to protect osc_extent, while after generic_file_aio_write() done, it could possible need to kill suid or sgid, which will call ll_setattr_raw() to change the inode's attribute, and it does not involve size. So the ll_truc_sem write semaphore should be constrained around ll_setattr_ost() to not come across the lli_trunc_sem read semaphore get from the normal file write path. Signed-off-by: Bobi Jam <bobijam.xu@intel.com> Reviewed-on: http://review.whamcloud.com/9267 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4627 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27Merge tag 'usb-3.15-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are a number of USB fixes for 3.15-rc3. The majority are gadget fixes, as we didn't get any of those in for 3.15-rc2. The others are all over the place, and there's a number of new device id addtions as well." * tag 'usb-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (35 commits) usb: option: add and update a number of CMOTech devices usb: option: add Alcatel L800MA usb: option: add Olivetti Olicard 500 usb: qcserial: add Sierra Wireless MC7305/MC7355 usb: qcserial: add Sierra Wireless MC73xx usb: qcserial: add Sierra Wireless EM7355 USB: io_ti: fix firmware download on big-endian machines usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM xhci: extend quirk for Renesas cards xhci: Switch Intel Lynx Point ports to EHCI on shutdown. usb: xhci: Prefer endpoint context dequeue pointer over stopped_trb phy: core: make NULL a valid phy reference if !CONFIG_GENERIC_PHY phy: fix kernel oops in phy_lookup() phy: restore OMAP_CONTROL_PHY dependencies phy: exynos: fix building as a module USB: serial: fix sysfs-attribute removal deadlock usb: wusbcore: fix panic in wusbhc_chid_set usb: wusbcore: convert nested lock to use spin_lock instead of spin_lock_irq uwb: don't call spin_unlock_irq in a USB completion handler usb: chipidea: coordinate usb phy initialization for different phy type ...
2014-04-27staging/lustre/llite: issue OST_SYNC for fsync()Bobi Jam
The last parameter @datasync of fsync() has following indication: * if datasync=0, we'd always flush data and metadata * if datasync=1, we'd always flush data while does not flush modifed metadata unless that metadata is needed in order to allow a subsequent data retrieval to be correctly handled. For example, a change to the file size would require a metadata flush. Lustre client can not tell the difference easily, and would issue MDS_SYNC and OST_SYNC in all cases. Signed-off-by: Bobi Jam <bobijam.xu@intel.com> Reviewed-on: http://review.whamcloud.com/8684 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4388 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: fix permission problem of setfaclLi Xi
Setxattr does not check the permission when setting ACL xattrs. This will cause security problem because any user can walk around permission checking by changing ACL rules. Signed-off-by: Li Xi <lixi@ddn.com> Reviewed-on: http://review.whamcloud.com/9473 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4704 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/hsm: HSM requests not deliveredJames Nunez
The total size of an HSM archive request may exceed the desired (LNET) message. When this happens, it can hang the client and not allow the archive request to succeed. Before we know the total size of the hsm_action_items, we need to limit the size of the reguest. Doing this limits the number of items that can be sent in one archive request. We'e reduced the size allowed for the user archive request to MDS_MAXREQSIZE/3. Signed-off-by: James Nunez <james.a.nunez@intel.com> Reviewed-on: http://review.whamcloud.com/9393 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4639 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/hsm: count NULL terminator in hai_zero/hal_sizePeng Tao
If fsname is 8-byte aligned, hai_zero fails to count the ending NULL terminator causing hai to directly attached after fsname and future hai_zero will return a different position for first hai. Signed-off-by: Peng Tao <bergwolf@gmail.com> Reviewed-on: http://review.whamcloud.com/9431 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4689 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/obdclass: remove uses of lov_stripe_mdJohn L. Hammond
Remove the unused function llog_obd_add(). Remove the unused count and parameters from llog_cancel(). Move dump_lsm() from obdclass to the only module that uses it (lov). Remove obd_lov.h. Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-on: http://review.whamcloud.com/8545 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675 Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/lov: remove unused lov llog codeJohn L. Hammond
Remove the unused functions lov_llog_init(), lov_llog_finish(), their supporting functions, and the file lov_log.c. Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-on: http://review.whamcloud.com/8539 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: quiet console permission error messagesAndreas Dilger
Quiet some common console error messages for permission errors that can be hit in common cases. Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-on: http://review.whamcloud.com/8988 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4522 Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Faccini Bruno <bruno.faccini@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre: restore __GFP_WAIT flag to memalloc callsAnn Koehler
In Lustre 2.4, the flags passed to the memory allocation functions are translated from CFS enumeration values types to the kernel GFP values by calling cfs_alloc_flags_to_gfp(). This function adds __GFP_WAIT to all flags except CFS_ALLOC_ATOMIC. In 2.5, when the cfs wrappers were dropped, cfs_alloc_flags_to_gfp() was removed and the CFS_ALLOC_xxxx was simply replaced with __GFP_xxxx. This means that most memory allocation calls are missing the __GFP_WAIT flag. The result is that Lustre experiences more ENOMEM errors, many of which the higher levels of Lustre do not handle robustly. Notes GFP_NOFS = __GFP_WAIT | __GFP_IO. So the patch replaces __GFP_IO with GFP_NOFS. Patch does not add __GFP_WAIT to GFP_IOFS. GFP_IOFS was not used in Lustre 2.4 so it has never been used with __GFP_WAIT. Signed-off-by: Ann Koehler <amk@cray.com> Signed-off-by: Emoly Liu <emoly.liu@intel.com> Reviewed-on: http://review.whamcloud.com/9223 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4357 Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/ptlrpc: add rpc_cacheAndriy Skulysh
Add rpc_cache for allocating ptlrpc_requests. Xyratex-bug-id: MRP-689 Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com> Signed-off-by: Niu Yawei <yawei.niu@intel.com> Reviewed-on: http://review.whamcloud.com/6874 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2424 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Lai Siyao <lai.siyao@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/gss: fix few issues found by Klocwork Insight toolDmitry Eremin
Array 'message_buf' of size 500 may use index value(s) -1 Object 'enc_key.data' was freed at line 164 after being freed by calling 'free' at line 150. Also there are 3 similar errors on line(s) 164. Suspicious dereference of pointer 'vmsg' before NULL check at line 187. Also there are 2 similar errors on line(s) 196, 205. Suspicious dereference of pointer 'rmsg' before NULL check at line 191. Also there are 2 similar errors on line(s) 200, 209. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-on: http://review.whamcloud.com/9274 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/ptlrpc: don't try to recover no_recov connectionAndreas Dilger
If a connection has been stopped with ptlrpc_pinger_del_import() and marked obd_no_recov, don't reconnect in ptlrpc_disconnect_import() if the import is already disconnected. Otherwise, without the pinger it will just wait there indefinitely for the reconnection that will never happen. Put the obd_no_recov check inside ptlrpc_import_in_recovery() so that any threads waiting on the connection to recover would also be broken out of their sleep if obd_no_recov is set. Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-on: http://review.whamcloud.com/8996 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4413 Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: wangdi <di.wang@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/clio: clear nowait flag agl lock re-enqueueNiu Yawei
The LDLM_FL_BLOCK_NOWAIT flag should be cleared when re-enqueue the agl lock as normal glimpse, otherwise, it won't get size back if there is conflicting locks on other client. Signed-off-by: Niu Yawei <yawei.niu@intel.com> Reviewed-on: http://review.whamcloud.com/9249 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4597 Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Ned Bass <bass6@llnl.gov> Reviewed-by: Fan Yong <fan.yong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/ldlm: Hold lock when clearing flagLi Xi
This patch moves lock's skip flag clearing from lru-delete to lru-add code to prevent clearing lock's flag without resource lock protection. Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Bobi Jam <bobijam.xu@intel.com> Reviewed-on: http://review.whamcloud.com/8772 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4269 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/lnet: Dropped messages are not accounted correctlyMatt Ezell
LNET messages that are dropped are not accounted for correctly in /proc/sys/lnet/stats. What I assume to be a simple typo is causing drop_length to be double-counted and drop_count to never be incremented. Signed-off-by: Matt Ezell <ezellma@ornl.gov> Reviewed-on: http://review.whamcloud.com/9096 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4577 Reviewed-by: James Nunez <james.a.nunez@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/osc: don't activate deactivated obd_importHongchao Zhang
In ptlrpc_activate_import(), obd_import->imp_deactive should be checked if it is deactivated, otherwise it will trigger an LBUG in ptlrpc_invalidate_import(): ptlrpc_invalidate_import() ASSERTION(imp->imp_invalid) failed Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com> Reviewed-on: http://review.whamcloud.com/8747 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4386 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Fan Yong <fan.yong@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/ptlrpc: Remove log message about export timer updateCheng Shao
Function ptlrpc_update_export_timer generates lots of D_HA level log messages whenever the export timer gets updated. Those log messages are found little use for issue investigations, and it will take space in the Lustre log buffer. We are removing it now. Xyratex-bug-id: MRP-733 Signed-off-by: Cheng Shao <cheng_shao@xyratex.com> Reviewed-on: http://review.whamcloud.com/9147 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4590 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27staging/lustre/ptlrpc: Fix assertion failure of null_alloc_rs()Patrick Farrell
lustre_get_emerg_rs() set the size of the reply buffer to zero by mistake, which will cause LBUG in null_alloc_rs() when memory pressure is high. This patch fix this problem and adds a size check to avoid the problem of insufficient buffer size. Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Patrick Farrell <paf@cray.com> Reviewed-on: http://review.whamcloud.com/8200 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3680 Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-27Merge tag 'pm+acpi-3.15-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI and power management fixes from Rafael Wysocki: "These include a fix for a recent ACPI regression related to device notifications, intel_idle fix related to IvyTown support, fix for a buffer size issue in ACPICA, PM core fix related to the "freeze" sleep state, four fixes for various types of breakage in cpufreq drivers, a PNP workaround for a wrong memory region size in ACPI tables, and a fix and cleanup for the ACPI tools Makefile. Specifics: - Fix for broken ACPI notifications on some systems caused by a recent ACPI hotplug commit that blocked the propagation of unknown type notifications to device drivers inadvertently. - intel_idle fix to make the IvyTown C-states handling (added recently) work as intended which now is broken due to missing braces. From Christoph Jaeger. - ACPICA fix to make it allocate buffers of the right sizes for the Generic Serial Bus operation region access. From Lv Zheng. - PM core fix unblocking cpuidle before entering the "freeze" sleep state which causes that state to be able to actually save more energy than runtime idle. - Configuration and build fixes for the highbank and powernv cpufreq drivers from Kefeng Wang and Srivatsa S Bhat. - Coccinelle warning fix related to error pointers for the unicore32 cpufreq driver from Duan Jiong. - Integer overflow fix for the ppc-corenet cpufreq driver from Geert Uytterhoeven. - Workaround for BIOSes that don't report the entire Intel MCH area in their ACPI tables from Bjorn Helgaas. - ACPI tools Makefile fix and cleanup from Thomas Renninger" * tag 'pm+acpi-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / notify: Do not block unknown type notifications in root handler PNP: Work around BIOS defects in Intel MCH area reporting cpufreq: highbank: fix ARM_HIGHBANK_CPUFREQ dependency warning cpufreq: ppc: Fix integer overflow in expression cpufreq, powernv: Fix build failure on UP cpufreq: unicore32: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO PM / suspend: Make cpuidle work in the "freeze" state intel_idle: fix IVT idle state table setting ACPICA: Fix buffer allocation issue for generic_serial_bus region accesses. tools/power/acpi: Minor bugfixes
2014-04-26staging: rtl8723au: Get rid of _rtw_free_network23a_nolock23a()Jes Sorensen
_rtw_free_network23a() and _rtw_free_network23a_nolock23a() are now identical - one copy should do. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-26staging: rtl8723au: rtw_free_network_queue23a() eliminate unused argument ↵Jes Sorensen
'isfreeall' Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-26staging: rtl8723au: _rtw_free_network23a(): Remove unused argument 'isfreeall'Jes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-26staging: rtl8723au: _rtw_free_network23a(): Remove write-only variable ↵Jes Sorensen
'lifetime' Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>