summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2013-07-23staging: ozwpan: Remove old debug macro.Joe Perches
Remove old oz_trace & oz_trace2 macro & related header files. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: ozwpan: Replace oz_trace with oz_dbgJoe Perches
Introduce new debug macros: oz_dbg, oz_cdev_dbg, oz_pd_dbg and then replace old oz_trace & oz_trace2 with new macro. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: ozwpan: Remove extra debug logs.Joe Perches
Remove unnecessary debug logs. Most of these logs print function name at the start of function, which are not really required. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: COMEDI_NI_LABPC_ISA no longer depends on VIRT_TO_BUSIan Abbott
After migrating ISA DMA support from the "ni_labpc" module to the new "ni_labpc_isadma" module, the `COMEDI_NI_LABPC_ISA` configuration option no longer depends on `VIRT_TO_BUS`, so remove the dependency. (The new `COMEDI_NI_LABPC_ISADMA` option does depend on `VIRT_TO_BUS` but is not configured manually and is only selected automatically if the `VIRT_TO_BUS` and `ISA_DMA_API` options are set.) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: tidy up after DMA code migrationIan Abbott
After migrating the ISA DMA handling code to the "ni_labpc_isadma" module, get rid of an unneeded `#include` and a couple of unused static variables. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: migrate DMA status handlingIan Abbott
Migrate the code for checking and handling the interrupt status handling for ISA DMA transfers into new a new function `labpc_handle_dma_status()` in the "ni_labpc_isadma" module. Provide a dummy inline function in "ni_labpc_isadma.h" if the "ni_labpc_isadma" module is not being built. The static function `handle_isa_dma()` also needs to move across to the new module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: migrate labpc_drain_dma()Ian Abbott
Move `labpc_drain_dma()` into the "ni_labpc_isadma" module. Provide a dummy inline function in "ni_labpc_isadma.h" if the module is not being built. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: migrate DMA transfer set-upIan Abbott
Migrate the code for setting up an ISA DMA transfer into a new function `labpc_setup_dma()` in the "ni_labpc_isadma" module. Provide a dummy inline function in "ni_labpc_isadma.h" if the "ni_labpc_isadma" module is not being built. The static function `labpc_suggest_transfer_size()` also needs to move across to the new module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: move register defs to new fileIan Abbott
The new "ni_labpc_isadma" module will need to access some register definitions from "ni_labpc.c", which is not part of the module's source. Move all the register definitions into a new, common header file "ni_labpc_regs.h". Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: use labpc_have_dma_chan()Ian Abbott
Call the new static inline function `labpc_have_dma_chan()` from `labpc_ai_cmd()` to check if the ISA DMA channel has been initialized, tidying up the surrounding code and removing an `#ifdef`. If the "ni_labpc_isadma" module is not being built, `labpc_have_dma_chan()` doesn't bother checking the DMA channel and just returns `false`, allowing the compiler to optimize out a small amount of code. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc_isadma: add labpc_have_dma_chan()Ian Abbott
Add a static inline function to "ni_labpc_isadma.h" to test if a DMA channel has been set-up, in which case `devpriv->dma_chan` will be non-zero (where `devpriv` point to the private data for the comedi device). If the "ni_labpc_isadma" module is not being built, don't bother checking `devpriv->dma_chan`; just return `false` as this may help the compiler to optimize out some unreachable code. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: migrate DMA channel init & freeIan Abbott
Migrate the code for requesting an ISA DMA channel and a DMA buffer, and the code for freeing them into two new functions in the "ni_labpc_isadma" module: `labpc_init_dma_chan()` and `labpc_free_dma_chan()`. Dummy inline functions are provided in "ni_labpc_isadma.h" if the "ni_labpc_isadma" module is not being built. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc_isadma: new module for ISA DMA supportIan Abbott
It's just an empty module at the moment, selected by COMEDI_NI_LABPC_ISA && ISA_DMA_API && VIRT_TO_BUS, but will be populated by later patches to migrate ISA DMA support for NI Lab-PC cards out of the "ni_labpc" module. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: don't clear cmd3 bits explicitly in labpc_ai_cmd()Ian Abbott
`labpc_ai_cmd()` calls `labpc_cancel()` which already sets `devpriv->cmd3` to 0. Remove the lines from `labpc_ai_cmd()` that clear specific bits in `devpriv->cmd3` explicitly as they have no effect. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ni_labpc: fix possible double-free of dma_bufferIan Abbott
If `labpc_attach()` allocates memory for `devpriv->dma_buffer` but fails to request a DMA channel, it frees `devpriv->dma_buffer` but leaves the pointer set. Later, `labpc_detach()` frees `devpriv->dma_buffer` again, which means it has been freed twice in this case. Fix it by only setting `devpriv->dma_buffer` in `labpc_attach()` if the DMA channel was requested successfully. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: use a mutex when accessing driver listIan Abbott
Low-level comedi drivers registered with the comedi core by `comedi_driver_register()` are linked together into a simple linked list headed by the `comedi_drivers` variable and chained by the `next` member of `struct comedi_driver`. A driver is removed from the list by `comedi_driver_unregister()`. The driver list is iterated through by `comedi_device_attach()` when the `COMEDI_DEVCONFIG` ioctl is used to attach a "legacy" device to a driver, and is also iterated through by `comedi_read()` in "proc.c" when reading "/proc/comedi". There is currently no protection against items being added or removed from the list while it is being iterated. Add a mutex `comedi_drivers_list_lock` to be locked while adding or removing an item on the list, or when iterating through the list. `comedi_driver_unregister()` also checks for and detaches any devices using the driver. This is currently done before unlinking the driver from the list, but it makes more sense to unlink the driver from the list first to prevent `comedi_device_attach()` attempting to use it, so move the unlinking part to the start of the function. Also, in `comedi_device_attach()` hold on to the mutex until we've finished attempting to attach the device to avoid it interfering with the detachment in `comedi_driver_unregister()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: return void from comedi_driver_unregister()Ian Abbott
'Unregister' functions generally return `void`. `comedi_driver_unregister()` currently returns an `int` errno value. Nothing looks at the return value. Change the return type to `void`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: pcl724: add support for the PCM-IO48 PC/104 boardH Hartley Sweeten
This driver can support the WinSystems PCM-IO48 PC/104 board. That board has two 8255 devices providing 48 digital I/O channels. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: ii_pci20kc: this is an ISA board not a PCI boardH Hartley Sweeten
The Intelligent Instrumentation PCI-20001C board is a legacy PC/XT/AT 8-bit ISA board not a PCI board. The "PCI" appears to mean "Personal Computer Instrumentation". Move the Kconfig option into the COMEDI_ISA group. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: do not include <linux/delay.h> if its not neededH Hartley Sweeten
Some of the comedi files include this header but don't need it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: drivers do not need <linux/ioport.h>H Hartley Sweeten
All the ioport resources are managed by the comedi core. None of the drivers depend on <linux/ioport.h>. Remove the includes. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: don't rely on comedidev.h to include headersH Hartley Sweeten
comedidev.h is the main kernel header for comedi. Every comedi driver includes this header which then includes a number of <linux/*> headers. All the drivers need <linux/module.h> and some of them need <linux/delay.h>. The rest are not needed by any of the drivers. Remove all the includes in comedidev.h except for <linux/dma-mapping.h>, which is needed to pick up the enum dma_data_direction for the comedi_subdevice definition, and "comedi.h", which is the uapi header for comedi. Add <linux/module.h> to all the comedi drivers and <linux/delay.h> to the couple that need it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: use comedi_alloc_devpriv()H Hartley Sweeten
Use the helper function to allocate memory and set the comedi_device private data pointer. This removes the dependency on slab.h from most of the drivers so remove the global #include in comedidev.h and the local #include in some of the drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: comedi: drivers: introduce comedi_alloc_devpriv()H Hartley Sweeten
Introduce a helper function to allocate memory and set the comedi_device private data pointer. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: lustre: remove unused "helper" macrosGreg Kroah-Hartman
This removes a bunch of unused helper macros in the kp30.h file as they were not being used anywhere, and they better not be used in the future. Cc: Peng Tao <tao.peng@emc.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: lustre: use ERR_CAST() functionLaurent Navet
use ERR_CAST() function instead of ERR_PTR() and PTR_ERR() found using coccinelle and err_cast.cocci Signed-off-by: Laurent Navet <laurent.navet@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: lustre: Fix typo in printkMasanari Iida
Correct spelling typo in printk within staging/lustre Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/mdc: Keep resend FLocksBruno Faccini
FLocks requests (particulary F_UNLCKs) can't be trashed upon comm problems with Server/MDS nor upon kill/exit, thus we need to keep retry/send. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2665 Lustre-change: http://review.whamcloud.com/6415 Signed-off-by: Bruno Faccini <bruno.faccini@intel.com> Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/scrub: purge inconsistenct objects after OI scrubFan Yong
When OI scrub repaired the found inconsistency, it needs to purge the old object out of cache; otherwise, others may still use those cached stale information. Original patch adds functions in obdclass that is only used by server. Drop that part. Only merge in error handling change. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3335 Lustre-change: http://review.whamcloud.com/6697 Signed-off-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/mdt: HSM on disk actions recordjcl
HSM coordinator memorizes all actions in a llog This patch implements the methods needed to create update display these records. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3339 Lustre-change: http://review.whamcloud.com/6529 Signed-off-by: JC Lafoucriere <jacques-charles.lafoucriere@cea.fr> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/style: removes obsolete EXPORT_SYMTAB macros v2Keith Mannthey
EXPORT_SYMTAB is obsolete after 2.4 kernel, this patch removes EXPORT_SYMTAB from the source code again. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1347 Lustre-change: http://review.whamcloud.com/6739 Signed-off-by: Keith Mannthey <keith.mannthey@intel.com> Reviewed-by: Peng Tao <bergwolf@gmail.com> Reviewed-by: Liu Xuezhao <xuezhao.liu@emc.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/llite: Anonymous dentry incorrectly identified as rootPatrick Farrell
When exporting Lustre via NFS on SLES11SP2, this check incorrectly identifies anonymous dentries as root dentries. This is due to a change in SLES11SP2 which makes the d_name.name for anonymous dentries the same as that for root dentries. (Details in LU-3484.) This changes the check to directly compare the value of the dentry pointer to the root dentry pointer found in the superblock, rather than using the name. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3484 Lustre-change: http://review.whamcloud.com/6726 Signed-off-by: Patrick Farrell <paf@cray.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Peng Tao <bergwolf@gmail.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Alexey Shvetsov <alexxy@gentoo.org> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/llite: error of listxattr when buffer is smallKeith Mannthey
According to the standard, listxattr(2) should return -1 and errno should be set to ERANGE if the size of the list buffer is too small to hold the result. However ll_listxattr() will return a value bigger than the size of buffer in some cases. Let's assume listxattr(2) returns SIZE when it is called with a large enough list buffer. If it's called again with a list buffer whose size is smaller than SIZE but bigger than (SIZE - 12), then listxattr(2) will return SIZE too. This patch fixes the problem. Original patch by Li Xi <pkuelelixi@gmail.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3403 Lustre-change: http://review.whamcloud.com/6463 Signed-off-by: Keith Mannthey <keith.mannthey@intel.com> Reviewed-by: Li Xi <pkuelelixi@gmail.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/llite: return valid fsid for statfsFan Yong
Lustre uses 64-bits inode number to identify object on client side. When re-export Lustre via NFS, NFS will detect whether support fsid via statfs(). For the non-support case, it will only recognizes and packs low 32-bits inode number in nfs handle. Such handle cannot be used to locate the object properly. To avoid patch linux kernel, Lustre client should generate fsid and return it via statfs() to up layer. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2904 Lustre-change: http://review.whamcloud.com/6493 Signed-off-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/obdclass: be more careful processing server nameNathaniel Clark
Because whole options line gets passed to exclude processing, don't search from end of passed in argument to determine fsname at beginning. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2200 Lustre-change: http://review.whamcloud.com/6197 Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/lmv: fix duplicate directory entriesNed Bass
Previously, I accidentally introduced a new way for duplicate directory entries to be returned from readdir(). That patch fails to properly decrement the nlupgs counter when breaking out of the inner-for loop. This accounting error causes an extra iteration of the inner-for loop when processing the next cfs page and a bad ldp_hash_end value is then saved in the lu_dirpage. To fix this, always decrement the nlupgs counter on entry into the inner loop. Note: this bug only affects architectures with > 4k-sized pages, e.g. PowerPC. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3182 Lustre-change: http://review.whamcloud.com/6405 Signed-off-by: Ned Bass <bass6@llnl.gov> Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Bobi Jam <bobijam@gmail.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/procfs: return -ENOMEM from lprocfs_register()John L. Hammond
In lprocfs_register(), if proc_mkdir() fails then return ERR_PTR(-ENOMEM) rather than NULL and hold _lprocfs_mutex for the whole function. In lprocfs_remove_nolock() return early if the entry is an error pointer. Improve error handling around lprocfs_register() in a few spots. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2650 Lustre-change: http://review.whamcloud.com/5161 Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Emoly Liu <emoly.liu@intel.com> Reviewed-by: Keith Mannthey <keith.mannthey@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/fld: prepare FLD module for client server splitLiu Xuezhao
Split FLD server from client, fld_{handler,index}.c are not compliled unless server support is enabled. Do not include dt_object.h or lustre_mdt.h in lustre_fld.h and fix the minor breakages caused by this elsewhere. Generally cleanup includes in lustre/fld. Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com> Signed-off-by: John L. Hammond <john.hammond@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1330 Lustre-change: http://review.whamcloud.com/2675 Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/lnet: remove empty file lnet/lnet/api-errno.cPeng Tao
The file is empty. We can just remove it. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2335 Lustre-change: http://review.whamcloud.com/5880 Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Li Wei <wei.g.li@intel.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/ldlm: Fix flock deadlock detection raceAndriy Skulysh
Deadlock isn't detected if 2 threads are trying to grant 2 locks which deadlock on each other. They call ldlm_flock_deadlock() simultaneously and deadlock ins't detected. The soulition is to add lock to blocking list before calling ldlm_flock_deadlock() Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1602 Lustre-change: http://review.whamcloud.com/3277 Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com> Reviewed-by: Vitaly Fertman <vitaly_fertman@xyratex.com> Reviewed-by: Bruce Korb <bruce_korb@xyratex.com> Reviewed-by: Keith Mannthey <keith.mannthey@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/llite: call simple_setattr() from ll_md_setattr()John L. Hammond
This partially reverts the change from "LU-2482 layout: introduce new layout for released files" by calling simple_setattr() from ll_md_setattr() without ATTR_SIZE set. Doing so avoids failed assertions in osc_page_delete(). Disable truncates on released files and modify sanity 229 accordingly. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3448 Lustre-change: http://review.whamcloud.com/6643 Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/mdt: duplicate link names in directoryAndreas Dilger
When creating a hard link to a file, the MDT/MDD/OSD code does not verify whether the target link name already exists in the directory. The ZFS ZAP code checks for duplicate entries. The add_dirent_to_buf() function in ldiskfs only checks entries for duplicates while it is traversing the leaf block looking for free space. Even if it scanned the whole leaf block, this would not work for non-htree directories since there is no guarantee that the name is being inserted into the same leaf block. To fix this, link should check target object doesn't exist as other creat operations. Add sanity.sh test_31o with multiple threads racing to link a new name into the directory, while ensuring that there is a free entry in the leaf block that is large enough to hold the duplicate name. This needs to be racy, because otherwise the client VFS will see the existing name and not send the RPC to the MDS, hiding the bug. Add DLDLMRES/PLDLMRES macros for printing the whole lock resource name (including the name hash) in LDLM_DEBUG() messages in a format similar to DFID/PFID so they can be found in debug logs more easily. The patch pickes client side change of the original patch, which only contains the DLM printk part. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2901 Lustre-change: http://review.whamcloud.com/6591 Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/crypto: add crc32c module loading to libcfsAlexander.Boyko
This patch add automatically module loading for crc32c when libcfs is starting. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2212 Lustre-change: http://review.whamcloud.com/4372 Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Shuichi Ihara <sihara@ddn.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/ptlrpc: Race between start and stop service threadsHiroya Nozaki
When ptlrpc_start_thread fails to create a new thread, it will finalize and free a struct ptlrpc_thread created and used here. Considering this, it can be a problem when ptlrpc_svcpt_stop_thread is driven and handles the struct ptlrpc_thread right after or right before failure of cfs_create_thread. Because this situation let the both of ptlrpc_start_thread and ptlrpc_svcpt_stop_threads access the freed ptlrpc_thread and cause OS panic. Or, it may happen that ptlrpc_svcpt_stop_threads waits forever holding an already-freed waitq. This patch adds an error handling into ptlrpc_start_thread to fix this problem. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2889 Lustre-change: http://review.whamcloud.com/5552 Signed-off-by: Hiroya Nozaki <nozaki.hiroya@jp.fujitsu.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Nikitas Angelinas <nikitas_angelinas@xyratex.com> Reviewed-by: Keith Mannthey <keith.mannthey@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/osc: Check return code for lu_kmem_initKeith Mannthey
lu_kmem_init can fail and returns has a return code. Check for this return code in lu_kmem_init. This issue was found during 2gb VM Racer testing Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3063 Lustre-change: http://review.whamcloud.com/6514 Signed-off-by: Keith Mannthey <keith.mannthey@intel.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/lfsck: LFSCK 1.5 technical debts (3)Fan Yong
Original patch resolves some LFSCK 1.5 technical debts, including: 1) Check and remove repeated linkea entries. 2) Merge some "goto" branches to make the code more readable. 3) Some comments about object's nlink inconsistency processing. This patch picks the obd flags change. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2915 Lustre-change: http://review.whamcloud.com/6344 Signed-off-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/llite: force lvb_data update after layout changejcl
When a file is restored the layout lock is first associated with the released layout and after restore it has to be assocaited with the new layout. This patch forces lvb_data update in ll_layout_fetch() even if one is present (case for released->normal state change) Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3299 Lustre-change: http://review.whamcloud.com/6291 Signed-off-by: JC Lafoucriere <jacques-charles.lafoucriere@cea.fr> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Johann Lombardi <johann.lombardi@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/fid: prepare FID module for client server splitLiu Xuezhao
Split FID server from client, fid_{handler,store,lib}.c are not compliled unless server support is enabled. Generally cleanup includes in lustre/fid/ and reduce the need for client code to directly or indirectly include {dt,md}_object.h. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1330 Lustre-change: http://review.whamcloud.com/2673 Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com> Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre: fix 'code maintainability' errorsSebastien Buisson
Fix 'code maintainability' issues found by Coverity version 6.5.1: Unused pointer value (UNUSED_VALUE) Pointer returned by function is never used. Missing varargs init or cleanup (VARARGS) va_end was not called for variable. Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3107 Lustre-change: http://review.whamcloud.com/5944 Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John Hammond <johnlockwoodhammond@gmail.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging/lustre/llapi: add user space method for lov_user_mdjcl
move lov_mds_md_size from obd_lov.h to lustre_idl.h to have it close to lov_mds_md definition. add lov_user_md_size() to compute lum size so llapi and user space utils do not use kernel internal definitions/methods Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3345 Lustre-change: http://review.whamcloud.com/6345 Signed-off-by: JC Lafoucriere <jacques-charles.lafoucriere@cea.fr> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>