summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'staging-4.16-rc1' of ↵Linus Torvalds2018-02-0184-2121/+949
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging/IIO updates from Greg KH: "Here is the big Staging and IIO driver patches for 4.16-rc1. There is the normal amount of new IIO drivers added, like all releases. The networking IPX and the ncpfs filesystem are moved into the staging tree, as they are on their way out of the kernel due to lack of use anymore. The visorbus subsystem finall has started moving out of the staging tree to the "real" part of the kernel, and the most and fsl-mc codebases are almost ready to move out, that will probably happen for 4.17-rc1 if all goes well. Other than that, there is a bunch of license header cleanups in the tree, along with the normal amount of coding style churn that we all know and love for this codebase. I also got frustrated at the Meltdown/Spectre mess and took it out on the dgnc tty driver, deleting huge chunks of it that were never even being used. Full details of everything is in the shortlog. All of these patches have been in linux-next for a while with no reported issues" * tag 'staging-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (627 commits) staging: rtlwifi: remove redundant initialization of 'cfg_cmd' staging: rtl8723bs: remove a couple of redundant initializations staging: comedi: reformat lines to 80 chars or less staging: lustre: separate a connection destroy from free struct kib_conn Staging: rtl8723bs: Use !x instead of NULL comparison Staging: rtl8723bs: Remove dead code Staging: rtl8723bs: Change names to conform to the kernel code staging: ccree: Fix missing blank line after declaration staging: rtl8188eu: remove redundant initialization of 'pwrcfgcmd' staging: rtlwifi: remove unused RTLHALMAC_ST and RTLPHYDM_ST staging: fbtft: remove unused FB_TFT_SSD1325 kconfig staging: comedi: dt2811: remove redundant initialization of 'ns' staging: wilc1000: fix alignments to match open parenthesis staging: wilc1000: removed unnecessary defined enums typedef staging: wilc1000: remove unnecessary use of parentheses staging: rtl8192u: remove redundant initialization of 'timeout' staging: sm750fb: fix CamelCase for dispSet var staging: lustre: lnet/selftest: fix compile error on UP build staging: rtl8723bs: hal_com_phycfg: Remove unneeded semicolons staging: rts5208: Fix "seg_no" calculation in reset_ms_card() ...
| * staging: lustre: separate a connection destroy from free struct kib_connDmitry Eremin2018-01-263-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic of the original commit 4d99b2581eff ("staging: lustre: avoid intensive reconnecting for ko2iblnd") was assumed conditional free of struct kib_conn if the second argument free_conn in function kiblnd_destroy_conn(struct kib_conn *conn, bool free_conn) is true. But this hunk of code was dropped from original commit. As result the logic works wrong and current code use struct kib_conn after free. > drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c > 3317 kiblnd_destroy_conn(conn, !peer); > ^^^^ Freed always (but should be conditionally) > 3318 > 3319 spin_lock_irqsave(lock, flags); > 3320 if (!peer) > 3321 continue; > 3322 > 3323 conn->ibc_peer = peer; > ^^^^^^^^^^^^^^ Use after free > 3324 if (peer->ibp_reconnected < KIB_RECONN_HIGH_RACE) > 3325 list_add_tail(&conn->ibc_list, > ^^^^^^^^^^^^^^ Use after free > 3326 &kiblnd_data.kib_reconn_list); > 3327 else > 3328 list_add_tail(&conn->ibc_list, > ^^^^^^^^^^^^^^ Use after free > 3329 &kiblnd_data.kib_reconn_wait); To avoid confusion this fix moved the freeing a struct kib_conn outside of the function kiblnd_destroy_conn() and free as it was intended in original commit. Cc: <stable@vger.kernel.org> # v4.6 Fixes: 4d99b2581eff ("staging: lustre: avoid intensive reconnecting for ko2iblnd") Signed-off-by: Dmitry Eremin <Dmitry.Eremin@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet/selftest: fix compile error on UP buildNeilBrown2018-01-231-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiled without CONFIG_SMP, we get a compile error as ->ctb_parts is not defined. There is already a function, cfs_cpt_cpumask(), which will get the cpumask we need, and which handles the UP case by returning a NULL pointer. So use that and handle NULL. Also avoid the #ifdef by allocating a cpumask_var and copying into it, rather than sharing the mask. Reported-by: kbuild test robot <fengguang.wu@intel.com> Fixes: 6106c0f82481 ("staging: lustre: lnet: convert selftest to use workqueues") Signed-off-by: NeilBrown <neilb@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: libcfs: Prevent harmless read underflowDan Carpenter2018-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | Because this is a post-op instead of a pre-op, then it means we check if knl_buffer[-1] is a space. It doesn't really hurt anything, but it causes a static checker warning so let's fix it. Fixes: d7e09d0397e8 ("staging: add Lustre file system client support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: remove null check before kfreeSumit Pundir2018-01-221-2/+1
| | | | | | | | | | | | | | | | Since kfree(NULL) is safe there is no need to place a check before it. Issue reported by checkpatch.pl Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: prefer kcalloc over kzalloc with multiplySumit Pundir2018-01-221-2/+2
| | | | | | | | | | | | | | | | | | Use kcalloc for allocating an array instead of kzalloc with multiply. kcalloc is the preferred API. Issue reported by checkpatch.pl Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: Align struct member identifiersFabian Huegel2018-01-221-22/+22
| | | | | | | | | | | | | | | | | | This patch properly left aligns all member identifiers in every struct defined in obd_class.h for better readability. Signed-off-by: Fabian Huegel <fabian_huegel@web.de> Signed-off-by: Christoph Volkert <linux@christoph-volkert.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: Fix comment styleFabian Huegel2018-01-221-20/+27
| | | | | | | | | | | | | | | | | | | | | | Most multi-line comments started on the first line, but the preferred linux kernel style is to start multi-line comments on the second line. Some comments became less readable after the change, so we changed them to single-line comments. Signed-off-by: Fabian Huegel <fabian_huegel@web.de> Signed-off-by: Christoph Volkert <linux@christoph-volkert.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: avoid uninitialized return valueArnd Bergmann2018-01-161-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc warns that the latest workqueue change leads to returning an uninitialized variable: drivers/staging/lustre/lnet/selftest/module.c: In function 'lnet_selftest_init': drivers/staging/lustre/lnet/selftest/module.c:98:10: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] A failure from alloc_ordered_workqueue() tends to indicate an out-of-memory condition, so return -ENOMEM in both cases. The second error path was a preexisting bug, where we always returned zero after a kvmalloc_array() failure. Fixes: 6106c0f82481 ("staging: lustre: lnet: convert selftest to use workqueues") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: fix build warning in module.cGreg Kroah-Hartman2018-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the latest patches from Neil, we are now getting a build warning: drivers/staging/lustre/lnet/selftest/module.c: In function ‘lnet_selftest_init’: drivers/staging/lustre/lnet/selftest/module.c:98:10: warning: ‘rc’ may be used uninitialized in this function [-Wmaybe-uninitialized] return rc; ^~ So fix this up by giving a default error value to rc. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Reported-by: kbuild test robot <fengguang.wu@intel.com> Cc: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: Align backslashes in multi-line macrosFabian Huegel2018-01-151-83/+83
| | | | | | | | | | | | | | | | | | This patch right aligns all backslashes in multi-line macros in obd_class.h for better readability. Signed-off-by: Fabian Huegel <fabian_huegel@web.de> Signed-off-by: Christoph Volkert <linux@christoph-volkert.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: Fix overlong linesFabian Huegel2018-01-151-4/+10
| | | | | | | | | | | | | | | | | | Fixed four lines that went over the 80 character limit to reduce checkpatch warnings. Signed-off-by: Fabian Huegel <fabian_huegel@web.de> Signed-off-by: Christoph Volkert <linux@christoph-volkert.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: Add identifier names to function declarationsFabian Huegel2018-01-151-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | Checkpatch was complaining about missing identifier names in function declarations. So we added the missing names according to the names in the respective function implementation. *obd_import* was sometimes named *import* and sometimes *imp* (in genops.c), so to avoid confusion we just named it imp everywhere. Signed-off-by: Fabian Huegel <fabian_huegel@web.de> Signed-off-by: Christoph Volkert <linux@christoph-volkert.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: Remove DECLARE_LU_VARS macroFabian Huegel2018-01-151-8/+8
| | | | | | | | | | | | | | | | | | | | | | This macro was only used in four places to declare two variables. It saved one line of code, but in our opinion hurt readability. So we removed the macro, substituting every occurrence with the declaration of the two variables (like the preprocessor would have done). Signed-off-by: Fabian Huegel <fabian_huegel@web.de> Signed-off-by: Christoph Volkert <linux@christoph-volkert.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: Enclose complex macros in do-while loopsFabian Huegel2018-01-151-4/+12
| | | | | | | | | | | | | | | | | | Some complex multi-line macros were not enclosed by a do-while(0), so we fixed that. Signed-off-by: Fabian Huegel <fabian_huegel@web.de> Signed-off-by: Christoph Volkert <linux@christoph-volkert.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: libcfs: remove workitem code.NeilBrown2018-01-155-582/+2
| | | | | | | | | | | | | | | | There are now no users. workqueues are doing the job that this used to do. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: convert selftest to use workqueuesNeilBrown2018-01-154-82/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of the cfs workitem library, use workqueues. As lnet wants to provide a cpu mask of allowed cpus, it needs to be a WQ_UNBOUND work queue so that tasks can run on cpus other than where they were submitted. This patch also exported apply_workqueue_attrs() which is a documented part of the workqueue API, that isn't currently exported. lustre needs it to allow workqueue thread to be limited to a subset of CPUs. Acked-by: Tejun Heo <tj@kernel.org> (for export of apply_workqueue_attrs) Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: remove LIBCFS_ALLOC, LIBCFS_FREE and related macros.NeilBrown2018-01-091-51/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | LIBCFS_ALLOC LIBCFS_ALLOC_ATOMIC LIBCFS_ALLOC_POST LIBCFS_CPT_ALLOC LIBCFS_FREE are no longer used, and so are removed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: replace LIBCFS_CPT_ALLOC()NeilBrown2018-01-0910-110/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LIBCFS_APT_ALLOC() calls kvmalloc_node() with GFP_NOFS which is not permitted. Mostly, a kmalloc_node(GFP_NOFS) is appropriate, though occasionally the allocation is large and GFP_KERNEL is acceptable, so kvmalloc_node() can be used. This patch introduces 4 alternatives to LIBCFS_CPT_ALLOC(): kmalloc_cpt() kzalloc_cpt() kvmalloc_cpt() kvzalloc_cpt(). Each takes a size, gfp flags, and cpt number. Almost every call to LIBCFS_CPT_ALLOC() passes lnet_cpt_table() as the table. This patch embeds that choice in the k*alloc_cpt() macros, and opencode kzalloc_node(..., cfs_cpt_spread_node(..)) in the one case that lnet_cpt_table() isn't used. When LIBCFS_CPT_ALLOC() is replaced, the matching LIBCFS_FREE() is also replaced, with with kfree() or kvfree() as appropriate. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: opencode LIBCFS_ALLOC_ATOMIC calls.NeilBrown2018-01-091-4/+3
| | | | | | | | | | | | | | | | Just call kzalloc(GFP_ATOMIC) directly. We don't need the warning on failure. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: cfs_percpt_alloc: use kvmalloc(GFP_KERNEL)NeilBrown2018-01-091-3/+3
| | | | | | | | | | | | | | | | | | this allocation is called from several places, but all are during initialization, so GFP_NOFS is not needed. So use kvmalloc and GFP_KERNEL. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: use kmalloc for allocating ksock_txNeilBrown2018-01-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The size of the data structure is primarily controlled by the iovec size, which is limited to 256. Entries in this vector are 12 bytes, so the whole will always fit in a page. So it is safe to use kmalloc (kvmalloc not needed). So replace LIBCFS_ALLOC with kmalloc. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet-route: use kmalloc for small allocationNeilBrown2018-01-091-3/+2
| | | | | | | | | | | | | | | | | | | | This allocation is reasonably small. As the function is called "*_locked", it might not be safe to perform a GFP_KERNEL allocation, so be safe and use GFP_NOFS. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: more conversions to GFP_KERNEL allocations.NeilBrown2018-01-096-48/+40
| | | | | | | | | | | | | | | | These are not called from filesystem context, so use GFP_KERNEL, not LIBCFS_ALLOC(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: more LIBCFS_ALLOC conversions to GFP_KERNEL allocations.NeilBrown2018-01-094-30/+23
| | | | | | | | | | | | | | | | None of these need GFP_NOFS so allocate directly. Change matching LIBCFS_FREE() to kfree() or kvfree(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: Convert more LIBCFS_ALLOC allocation to direct GFP_KERNELNeilBrown2018-01-094-38/+26
| | | | | | | | | | | | | | | | | | None of these need to be GFP_NOFS, so use GFP_KERNEL explicitly with kmalloc(), kvmalloc(), or kvmalloc_array(). Change matching LIBCFS_FREE() to kfree() or kvfree() Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: change some LIBCFS_ALLOC calls to k?alloc(GFP_KERNEL)NeilBrown2018-01-097-39/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an allocation happens from process context rather than filesystem context, it is best to use GFP_KERNEL rather than LIBCFS_ALLOC() which always uses GFP_NOFS. This include initialization during, or prior to, mount, and code run from separate worker threads. So for some of these cases, switch to kmalloc, kvmalloc, or kvmalloc_array() as appropriate. In some cases we preserve __GFP_ZERO (via kzalloc/kvzalloc), but in others it is clear that allocated memory is immediately initialized. In each case, the matching LIBCFS_FREE() is converted to kfree() or kvfree() This is just a subset of locations that need changing. As there are quite a lot, I've broken them up into several ad-hoc sets to avoid review-fatigue. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: use kmalloc/kvmalloc in router_procNeilBrown2018-01-091-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | The buffers allocated in router_proc are to temporarily hold strings created for procfs files. So they do not need to be zeroed and are safe to use GFP_KERNEL. So use kmalloc() directly except in two cases where it isn't trivial to confirm that the size is always small. In those cases, use kvmalloc(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: selftest: don't allocate small strings.NeilBrown2018-01-091-151/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the "name" buffers here are at most LST_NAME_SIZE+1 bytes, so 33 bytes at most. They are only used temporarily during the life of the function that allocates them. So it is much simpler to just allocate on the stack. Worst case is lst_tet_add_ioct(), which allocates 3 for these which 99 bytes on the stack, instead of the 24 that would have been allocated for 64-bit pointers. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: switch to cpumask_var_tNeilBrown2018-01-095-59/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | So that we can use the common cpumask allocation functions, switch to cpumask_var_t. We need to be careful not to free a cpumask_var_t until the variable has been initialized, and it cannot be initialized directly. So we must be sure either that it is filled with zeros, or that zalloc_cpumask_var() has been called on it. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.NeilBrown2018-01-0922-133/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All usages of the form LIBCFS_ALLOC(variable, sizeof(variable)) or LIBCFS_ALLOC(variable, sizeof(variable's-type)) are changed to variable = kzalloc(sizeof(...), GFP_NOFS); Similarly, all LIBCFS_FREE(variable, sizeof(variable)) become kfree(variable); None of these need the vmalloc option, or any of the other minor benefits of LIBCFS_ALLOC(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Staging: lustre: Fix prefer kcalloc over kzalloc with multiplySumit Pundir2018-01-081-1/+1
| | | | | | | | | | | | | | | | | | Use kcalloc for allocating an array instead of kzalloc with multiply. kcalloc is the preferred API. Issue reported by checkpatch.pl Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Staging: lustre: Fix prefer seq_puts to seq_printfSumit Pundir2018-01-081-3/+3
| | | | | | | | | | | | | | | | Use seq_puts() for strings without format specifiers instead of seq_printf(). Issue reported by checkpatch.pl Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * drivers: lustre: obdclass: simplify unregister_shrinker() usageAliaksei Karaliou2018-01-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | lu_global_fini() explicitly uses knowledge about shrinker's internals to make decision about calling of unregister_shrinker(). Now this check was integrated into unregister_shrinker(), so it is safe to call it against unregistered shrinker. Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet: discard CFS_ALLOC_PTRNeilBrown2018-01-082-8/+5
| | | | | | | | | | | | | | | | | | | | | | These trivial wrappers hurt readability and as they use kvmalloc, they are overly generic. So discard them and use kmalloc/kfree as is normal in Linux. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: lnet-lib: opencode some alloc/free functions.NeilBrown2018-01-088-89/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions just call LIBCFS_ALLOC() which in-turn calls kvmalloc(). In none of these cases is the 'vmalloc' option needed. LIBCFS_ALLOC also produces a warning if NULL is returned, but that can be provided with CONFIG_SLAB_DEBUG. LIBCFS_ALLOC zeros the memory, so we need to use __GFP_ZERO too. So with one exception where the alloc function is not trivial, open-code the alloc and free functions using kmalloc and kfree. Note that the 'size' used in lnet_md_alloc() is limited and less than a page because LNET_MAX_IOV is 256, so kvmalloc is not needed. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: libcfs: remove prngNeilBrown2018-01-083-148/+1
| | | | | | | | | | | | | | The cfs prng is no longer used, so discard it. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: replace cfs_get_random_bytes calls with get_random_byte()NeilBrown2018-01-083-3/+3
| | | | | | | | | | | | | | | | | | The cfs_get_random_bytes() interface adds nothing of value to get_random_byte() (which it uses internally). So just use the standard interface. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: replace cfs_srand() calls with add_device_randomness().NeilBrown2018-01-083-26/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only places that cfs_srand is called, the random bits are mixed with bits from get_random_bytes(). So it is equally effective to add entropy to either pool. So we can replace calls to cfs_srand() with calls that add the entropy with add_device_randomness(). That function adds time-based entropy, so we can discard the ktime_get_ts64 calls. One location in lustre_handles.c only adds timebased entropy. This cannot improve the entropy provided by get_random_bytes(), so just discard that call. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: replace cfs_rand() with prandom_u32_max()NeilBrown2018-01-084-23/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All occurrences of cfs_rand() % X are replaced with prandom_u32_max(X) cfs_rand() is a simple Linear Congruential PRNG. prandom_u32_max() is at least as random, is seeded with more randomness, and uses cpu-local state to avoid cross-cpu issues. This is the first step is discarding the libcfs prng with the standard linux prng. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: libcfs: remove wi_data from cfs_workitemNeilBrown2018-01-084-14/+11
| | | | | | | | | | | | | | | | | | | | In every case, the value passed via wi_data can be determined from the cfs_workitem pointer using container_of(). So use container_of(), and discard wi_data. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: libcfs: use a workqueue for rehash work.NeilBrown2018-01-084-75/+31
| | | | | | | | | | | | | | | | | | | | lustre has a work-item queuing scheme that provides the same functionality as linux work_queues. To make the code easier for linux devs to follow, change to use work_queues. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: obd_mount: fix possible race with module unload.NeilBrown2018-01-083-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lustre_fill_super() calls client_fill_super() without holding a reference to the module containing client_fill_super. If that module is unloaded at a bad time, this can crash. To be able to get a reference to the module using try_get_module(), we need a pointer to the module. So replace lustre_register_client_fill_super() and lustre_register_kill_super_cb() with a single lustre_register_super_ops() which also passed a module pointer. Then use a spinlock to ensure the module pointer isn't removed while try_module_get() is running, and use try_module_get() to ensure we have a reference before calling client_fill_super(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: obdclass: remove vfsmount option from client_fill_superNeilBrown2018-01-084-12/+8
| | | | | | | | | | | | | | | | This arg is always NULL and is never used. So discard it from this and related functions. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: obdclass: remove pointless struct lustre_mount_data2NeilBrown2018-01-081-15/+4
| | | | | | | | | | | | | | | | This is used to pass a void* and NULL to lustre_fill_super(). It is easier just to pass the void*. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: obdclass: discard FS_NEEDS_DEV flag.NeilBrown2018-01-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | Lustre mounts do not need a dev, as we can see from lustre_mount() calling mount_nodev(). So remove the flag which could cause confusion elsewhere. Also format lustre_fs_types so that fields line up. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: disable preempt while sampling processor id.NeilBrown2018-01-081-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling smp_processor_id() without disabling preemption triggers a warning (if CONFIG_DEBUG_PREEMPT). I think the result of cfs_cpt_current() is only used as a hint for load balancing, rather than as a precise and stable indicator of the current CPU. So it doesn't need to be called with preemption disabled. So disable preemption inside cfs_cpt_current() to silence the warning. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: lustre: use strim instead of cfs_trimwhite.NeilBrown2018-01-085-31/+10
| | | | | | | | | | | | | | | | | | Linux lib provides identical functionality to cfs_trimwhite, so discard that code and use the standard. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Merge 4.15-rc6 into staging-nextGreg Kroah-Hartman2018-01-021-13/+10
| |\ | | | | | | | | | | | | | | | We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | staging: lustre: Replace 'uint32_t' with 'u32' and 'uint64_t' with 'u64'Roman Storozhenko2017-12-214-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two reasons for replacing 'uint32_t' with 'u32' and 'uint64_t' with 'u64': 1) As Linus Torvalds have said we should use kernel types: http://lkml.iu.edu/hypermail//linux/kernel/1506.0/00160.html 2) There are only few places in the lustre codebase that use such types. In the most cases it uses 'u32' and 'u64'. Signed-off-by: Roman Storozhenko <romeusmeister@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>