Commit graph

1641 commits

Author SHA1 Message Date
Linus Torvalds 1081230b74 Merge branch 'for-4.3/core' of git://git.kernel.dk/linux-block
Pull core block updates from Jens Axboe:
 "This first core part of the block IO changes contains:

   - Cleanup of the bio IO error signaling from Christoph.  We used to
     rely on the uptodate bit and passing around of an error, now we
     store the error in the bio itself.

   - Improvement of the above from myself, by shrinking the bio size
     down again to fit in two cachelines on x86-64.

   - Revert of the max_hw_sectors cap removal from a revision again,
     from Jeff Moyer.  This caused performance regressions in various
     tests.  Reinstate the limit, bump it to a more reasonable size
     instead.

   - Make /sys/block/<dev>/queue/discard_max_bytes writeable, by me.
     Most devices have huge trim limits, which can cause nasty latencies
     when deleting files.  Enable the admin to configure the size down.
     We will look into having a more sane default instead of UINT_MAX
     sectors.

   - Improvement of the SGP gaps logic from Keith Busch.

   - Enable the block core to handle arbitrarily sized bios, which
     enables a nice simplification of bio_add_page() (which is an IO hot
     path).  From Kent.

   - Improvements to the partition io stats accounting, making it
     faster.  From Ming Lei.

   - Also from Ming Lei, a basic fixup for overflow of the sysfs pending
     file in blk-mq, as well as a fix for a blk-mq timeout race
     condition.

   - Ming Lin has been carrying Kents above mentioned patches forward
     for a while, and testing them.  Ming also did a few fixes around
     that.

   - Sasha Levin found and fixed a use-after-free problem introduced by
     the bio->bi_error changes from Christoph.

   - Small blk cgroup cleanup from Viresh Kumar"

* 'for-4.3/core' of git://git.kernel.dk/linux-block: (26 commits)
  blk: Fix bio_io_vec index when checking bvec gaps
  block: Replace SG_GAPS with new queue limits mask
  block: bump BLK_DEF_MAX_SECTORS to 2560
  Revert "block: remove artifical max_hw_sectors cap"
  blk-mq: fix race between timeout and freeing request
  blk-mq: fix buffer overflow when reading sysfs file of 'pending'
  Documentation: update notes in biovecs about arbitrarily sized bios
  block: remove bio_get_nr_vecs()
  fs: use helper bio_add_page() instead of open coding on bi_io_vec
  block: kill merge_bvec_fn() completely
  md/raid5: get rid of bio_fits_rdev()
  md/raid5: split bio for chunk_aligned_read
  block: remove split code in blkdev_issue_{discard,write_same}
  btrfs: remove bio splitting and merge_bvec_fn() calls
  bcache: remove driver private bio splitting code
  block: simplify bio_add_page()
  block: make generic_make_request handle arbitrarily sized bios
  blk-cgroup: Drop unlikely before IS_ERR(_OR_NULL)
  block: don't access bio->bi_error after bio_put()
  block: shrink struct bio down to 2 cache lines again
  ...
2015-09-02 13:10:25 -07:00
Linus Torvalds 2f37d65a6a Staging driver patches for 4.3-rc1
Here is the big staging driver updates for 4.3-rc1.
 
 Lots of things all over the place, almost all of them trivial fixups and
 changes.  The usual IIO updates and new drivers and we have added the
 MOST driver subsystem which is getting cleaned up in the tree.  The
 ozwpan driver is finally being deleted as it is obviously abandoned and
 no one cares about it.
 
 Full details are in the shortlog, and all of these have been in
 linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlXV9S8ACgkQMUfUDdst+ykAwQCfSOc+y5AG7+63cIdnLwRS3MdZ
 p3EAoLoJXl8+5hfIsRBlwXyLEkN33f/7
 =dD9z
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
 "Here is the big staging driver updates for 4.3-rc1.

  Lots of things all over the place, almost all of them trivial fixups
  and changes.  The usual IIO updates and new drivers and we have added
  the MOST driver subsystem which is getting cleaned up in the tree.
  The ozwpan driver is finally being deleted as it is obviously
  abandoned and no one cares about it.

  Full details are in the shortlog, and all of these have been in
  linux-next with no reported issues"

* tag 'staging-4.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (912 commits)
  staging/lustre/o2iblnd: remove references to ib_reg_phsy_mr()
  staging: wilc1000: fix build warning with setup_timer()
  staging: wilc1000: remove DECLARE_WILC_BUFFER()
  staging: wilc1000: remove void function return statements that are not useful
  staging: wilc1000: coreconfigurator.c: fix kmalloc error check
  staging: wilc1000: coreconfigurator.c: use kmalloc instead of WILC_MALLOC
  staging: wilc1000: remove unused codes of gps8ConfigPacket
  staging: wilc1000: remove unnecessary void pointer cast
  staging: wilc1000: remove WILC_NEW and WILC_NEW_EX
  staging: wilc1000: use kmalloc instead of WILC_NEW
  staging: wilc1000: Process WARN, INFO options of debug levels from user
  staging: wilc1000: remove unneeded tstrWILC_MsgQueueAttrs typedef
  staging: wilc1000: delete wilc_osconfig.h
  staging: wilc1000: delete wilc_log.h
  staging: wilc1000: delete wilc_timer.h
  staging: wilc1000: remove WILC_TimerStart()
  staging: wilc1000: remove WILC_TimerCreate()
  staging: wilc1000: remove WILC_TimerDestroy()
  staging: wilc1000: remove WILC_TimerStop()
  staging: wilc1000: remove tstrWILC_TimerAttrs typedef
  ...
2015-08-31 09:24:06 -07:00
Oleg Drokin 415bcb5c6e staging/lustre/o2iblnd: remove references to ib_reg_phsy_mr()
Removed references to ib_reg_phsy_mr() and PMR which was added
to deal with some Chelsio specific scenario, but no longer needed
now.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-18 19:53:41 -07:00
Ioan-Adrian Ratiu f157d807b9 staging: lustre: ptlrpc: add missing include directive
Without including ptlrpc_internal.h, GCC gives prototype warnings
"pack_generic.c:642:5: warning: no previous prototype for ..."
and sparse also complains "pack_generic.c:642:5: warning: symbol
'lustre_unpack_req_ptlrpc_body' was not declared. ..."

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:51:18 -07:00
Swee Hua Law 94a99b4611 staging: lustre: Do not init global to NULL
Remove "= NULL" in global variable

Signed-off-by: Swee Hua Law <sweehua81@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:48:34 -07:00
Joe Perches 8150a97fdd staging: lustre: Remove unnecessary externs
Using 'extern' is not necessary for function prototypes.

Miscellanea:

o Reflow alignments

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:48:34 -07:00
Swee Hua Law 049fbd9fcc staging: lustre: checkpatch: argument alignment for readability
Fix checkpatch problem: move last argument of the hlist..() back to same line

Signed-off-by: Swee Hua Law <sweehua81@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:47:41 -07:00
Swee Hua Law aa62a8415e staging: lustre: checkpatch: move */ block comment to next line
Fix checkpatch problem: move */ from end of line to new line

Signed-off-by: Swee Hua Law <sweehua81@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:47:41 -07:00
Swee Hua Law bcffa060c1 staging: lustre: checkpatch: symbol == NULL should be !symbol
Fix checkpatch problem: change == NULL comparison to !symbol

Signed-off-by: Swee Hua Law <sweehua81@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:47:41 -07:00
Swee Hua Law 1b680a8181 staging: lustre: checkpatch: do not init global to NULL
Fix checkpatch problem: remove NULL assignment fro global variable

Signed-off-by: Swee Hua Law <sweehua81@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:47:41 -07:00
Patrick Boettcher a836582655 staging: lustre-libcfs: make static-variable constant
This static can be made constant as it is never modified.

Found during sparse-cleanup.

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:46:02 -07:00
Patrick Boettcher 25bbe418f8 staging: lustre-libcfs: fix sparse warning
Fix sparse warnings of the following type:

warning: symbol '....' was not declared. Should it be static?

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:46:02 -07:00
Shraddha Barke 94858fecca Staging: lustre: libcfs: Remove unnecessary cast on void*
This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (void *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:44:45 -07:00
Oleg Drokin ad88aae057 staging/lustre/llite: get rid of unused ll_super_blocks list
ll_super_blocks became unused quite a while ago with switch
to the new CLIO code.
So this patch removes the list, ll_sb_lock spinlock that guards it
and superblock info ll_list linkage.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 17:33:23 -07:00
Kent Overstreet 54efd50bfd block: make generic_make_request handle arbitrarily sized bios
The way the block layer is currently written, it goes to great lengths
to avoid having to split bios; upper layer code (such as bio_add_page())
checks what the underlying device can handle and tries to always create
bios that don't need to be split.

But this approach becomes unwieldy and eventually breaks down with
stacked devices and devices with dynamic limits, and it adds a lot of
complexity. If the block layer could split bios as needed, we could
eliminate a lot of complexity elsewhere - particularly in stacked
drivers. Code that creates bios can then create whatever size bios are
convenient, and more importantly stacked drivers don't have to deal with
both their own bio size limitations and the limitations of the
(potentially multiple) devices underneath them.  In the future this will
let us delete merge_bvec_fn and a bunch of other code.

We do this by adding calls to blk_queue_split() to the various
make_request functions that need it - a few can already handle arbitrary
size bios. Note that we add the call _after_ any call to
blk_queue_bounce(); this means that blk_queue_split() and
blk_recalc_rq_segments() don't need to be concerned with bouncing
affecting segment merging.

Some make_request_fn() callbacks were simple enough to audit and verify
they don't need blk_queue_split() calls. The skipped ones are:

 * nfhd_make_request (arch/m68k/emu/nfblock.c)
 * axon_ram_make_request (arch/powerpc/sysdev/axonram.c)
 * simdisk_make_request (arch/xtensa/platforms/iss/simdisk.c)
 * brd_make_request (ramdisk - drivers/block/brd.c)
 * mtip_submit_request (drivers/block/mtip32xx/mtip32xx.c)
 * loop_make_request
 * null_queue_bio
 * bcache's make_request fns

Some others are almost certainly safe to remove now, but will be left
for future patches.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Ming Lei <ming.lei@canonical.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: drbd-user@lists.linbit.com
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Jim Paris <jim@jtan.com>
Cc: Philip Kelleher <pjk1939@linux.vnet.ibm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Acked-by: NeilBrown <neilb@suse.de> (for the 'md/md.c' bits)
Acked-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
[dpark: skip more mq-based drivers, resolve merge conflicts, etc.]
Signed-off-by: Dongsu Park <dpark@posteo.net>
Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
2015-08-13 12:31:33 -06:00
Greg Kroah-Hartman f70d631832 Merge 4.2-rc6 into staging-next
We want the IIO and staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-10 09:07:25 -07:00
Greg Kroah-Hartman 5d44f4b348 Merge 4.2-rc6 into char-misc-next
We want the fixes in Linus's tree in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-09 16:28:09 -07:00
Daniel Machon b963e7223c Staging: lustre/lustre/ptlrpc: service.c: Fixed issue with global integer being initialized to 0
Fixed global integer initialization issue.
Global variables should not be explicitly initialized to 0 or NULL.

Signed-off-by: Daniel Machon <dmachon.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-08 15:22:58 -07:00
Daniel Machon 550d35d816 Staging: lustre/lnet/selftest: framework.c: Fixed coding style issues
Fixed coding style issues where statement should be on the next line

Signed-off-by: Daniel Machon <dmachon.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-08 15:22:58 -07:00
Andrzej Hajda 741a3b0745 staging/lustre: use kmemdup rather than duplicating its implementation
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:16:58 -07:00
Miguel Bernabeu Diaz 8a1d7b09e7 Staging: lustre: lnet: Remove unnecessary parentheses on return
Removed three instances of parentheses in return calls that are
unnecessary and do not contribute to readability.

Signed-off-by: Miguel Bernabeu Diaz <miguelbernadi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:40 -07:00
Miguel Bernabeu Diaz 276479ff68 staging: lustre: Fix space before '[' error
Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['

Signed-off-by: Miguel Bernabeu Diaz <miguelbernadi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:40 -07:00
Miguel Bernabeu Diaz 270f0c31b4 staging: lustre: Fix space before '(' warnings
Fix several instances of checkpatch.pl warning:
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Miguel Bernabeu Diaz <miguelbernadi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:40 -07:00
Miguel Bernabeu Diaz 83b912c67b staging: lustre: Fix space before '++' error
Fix checkpatch.pl error:
ERROR: space prohibited before that '++' (ctx:WxO)

Signed-off-by: Miguel Bernabeu Diaz <miguelbernadi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:40 -07:00
Miguel Bernabeu Diaz e39f6efaa1 staging: lustre: Fix code indent error
Fix checkpatch.pl error:
ERROR: code indent should use tabs where possible

Signed-off-by: Miguel Bernabeu Diaz <miguelbernadi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:40 -07:00
Miguel Bernabeu Diaz 66a84f8ae1 staging: lustre: Unnecessary line continuation
Fix checkpatch.pl warning:
WARNING: Avoid unnecessary line continuations

Signed-off-by: Miguel Bernabeu Diaz <miguelbernadi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:40 -07:00
Miguel Bernabeu Diaz 6255049d39 staging: lustre: Fix style warning on header
Fix checkpatch.pl warning:
WARNING: Use #include <linux/io.h> instead of <asm/io.h>

Signed-off-by: Miguel Bernabeu Diaz <miguelbernadi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 12:19:35 -07:00
Shraddha Barke 4f016420d3 Staging: lustre: obdclass: Use kasprintf
This patch uses kasprintf which combines kzalloc and sprintf.
kasprintf also takes care of the size calculation.

Semantic patch used is as follows:

@@
expression a,flag;
expression list args;
statement S;
@@

 a =
- \(kmalloc\|kzalloc\)(...,flag)
+ kasprintf (flag,args)
  <... when != a
  if (a == NULL || ...) S
  ...>
- sprintf(a,args);

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 12:18:01 -07:00
Shraddha Barke 91f2208c37 Staging: lustre: mgc: Replace comma with a semicolon
Replace comma between expression statements by a semicolon.
The semantic patch used is as follows:

@@
expression e1,e2;
@@
e1
- ,
+ ;
e2;

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 12:18:01 -07:00
Shraddha Barke 9b37465e40 Staging: lustre: libcfs: Replace comma with a semicolon
Replace comma between expression statements by a semicolon.
The semantic patch used is as follows:

@@
expression e1,e2;
@@
e1
- ,
+ ;
e2;

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 12:18:00 -07:00
Shraddha Barke b785675385 Staging: lustre: osc: Drop unnecessary cast on void *
This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 12:18:00 -07:00
Shraddha Barke 45b30514a3 Staging: lustre: lov: Drop unnecessary cast on void *
This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 12:18:00 -07:00
Shraddha Barke a12aaa92f3 Staging: lustre: libcfs: Drop unnecessary cast on void*
This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 12:18:00 -07:00
Oleg Drokin f72f130d87 staging/lustre: Properly reference kthread_run instead of cfs_daemonize
cfs_daemonize is long gone and replaced by a proper call to kthread_run,
so update the comment to reflect that fact.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 11:55:44 -07:00
Oleg Drokin 967ef593bf staging/lustre/ptlrpc: Remove stray cfs_daemonize comment
Ever since daemonize was removed in 3.18, there are no longer
any flags passed to kthread_run.
Most of the comments were deleted, but this one lingered on
until now.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 11:55:44 -07:00
Greg Kroah-Hartman f368ed6088 char: make misc_deregister a void function
With well over 200+ users of this api, there are a mere 12 users that
actually checked the return value of this function.  And all of them
really didn't do anything with that information as the system or module
was shutting down no matter what.

So stop pretending like it matters, and just return void from
misc_deregister().  If something goes wrong in the call, you will get a
WARNING splat in the syslog so you know how to fix up your driver.
Other than that, there's nothing that can go wrong.

Cc: Alasdair Kergon <agk@redhat.com>
Cc: Neil Brown <neilb@suse.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Christine Caulfield <ccaulfie@redhat.com>
Cc: David Teigland <teigland@redhat.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05 10:35:49 -07:00
Guenter Roeck fb1de5a4c8 staging: lustre: Include unaligned.h instead of access_ok.h
Including access_ok.h causes the ia64:allmodconfig build (and maybe others)
to fail with

include/linux/unaligned/le_struct.h:6:19: error:
	redefinition of 'get_unaligned_le16'
include/linux/unaligned/access_ok.h:7:19: note:
	previous definition of 'get_unaligned_le16' was here
include/linux/unaligned/le_struct.h:26:20: error:
	redefinition of 'put_unaligned_le32'
include/linux/unaligned/access_ok.h:42:20: note:
	previous definition of 'put_unaligned_le32' was here
include/linux/unaligned/le_struct.h:31:20: error:
	redefinition of 'put_unaligned_le64'
include/linux/unaligned/access_ok.h:47:20: note:
	previous definition of 'put_unaligned_le64' was here

Include unaligned.h instead and leave it up to the architecture to decide
how to implement unaligned accesses.

Fixes: 8c4f136497 ("Staging: lustre: Use put_unaligned_le64")
Cc: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-04 22:13:25 -07:00
Zoltán Lajos Kis a96389d9ad staging: lustre: service.c: make local functions static
Makes functions that are not used outside the file in which they are defined
static, as reported by sparse:

drivers/staging/lustre/lustre/ptlrpc/service.c:72:35: warning: symbol
'ptlrpc_alloc_rqbd' was not declared. Should it be static?
1065 drivers/staging/lustre/lustre/ptlrpc/service.c:105:1: warning:
symbol 'ptlrpc_free_rqbd' was not declared. Should it be static?
1066 drivers/staging/lustre/lustre/ptlrpc/service.c:122:1: warning:
symbol 'ptlrpc_grow_req_bufs' was not declared. Should it be static?
1067 drivers/staging/lustre/lustre/ptlrpc/service.c:3055:5: warning:
symbol 'ptlrpc_svcpt_health_check' was not declared. Should it be
static?

Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>"
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:51:47 -07:00
Zoltán Lajos Kis 5b34cd2993 staging: lustre: echo_client: fix sparse declaration warnings
Fixes the following sparse warnings:

drivers/staging/lustre/lustre/obdecho/echo_client.c:2142:5: warning: symbol 'echo_client_init' was not declared. Should it be static?
drivers/staging/lustre/lustre/obdecho/echo_client.c:2157:6: warning: symbol 'echo_client_exit' was not declared. Should it be static?

Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>"
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:51:47 -07:00
Oleg Drokin 81e053c75a staging/lustre: Get rid of inode_dio_write_done and inode_dio_read
These primitives are long deprecated and unused.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:48:17 -07:00
Oleg Drokin 66a23f0cc2 staging/lustre: Get rid of ll_pagevec_ macros
They are noop anyways.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:48:17 -07:00
Oleg Drokin 9d5be52f98 staging/lustre: Use hlist primitives directly
Get rid of ll_d_hlist* compat defines.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:48:16 -07:00
Oleg Drokin 56ea686bb7 staging/lustre: Drop FMODE_UNSIGNED_OFFSET define
It's not really used anywhere.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:46:44 -07:00
Oleg Drokin 1a3555cd32 staging/lustre: remove unused ll_quota_on and ll_quota_off
They are not used anywhere, so safe to drop.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:46:43 -07:00
Oleg Drokin c625ae0713 staging/lustre: Drop SEEK_* definition checks
SEEK_DATA and SEEK_HOLE are always defined in the kernel,
drop the definition checks

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 17:46:43 -07:00
Viresh Kumar 7f44cb0ba8 drivers: staging: Drop unlikely before IS_ERR(_OR_NULL)
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

This also replaces an IS_ERR(x) + (x == NULL) check to IS_ERR_OR_NULL
check.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:18:43 -07:00
Oleg Drokin 176d1b9643 staging/lustre/llite: Don't set page writeback on non-dirty page
New writeback changes in 4.2-RC1 have exposed that we incorrectly
set page_writeback on a page that is being written synchronously,
which aside from this new crash (dereference of NULL inode->i_wb
from set_page_writeback) likely threw off some related page
statistics in the past.

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000138
 IP: [<ffffffff8140d90a>] __percpu_counter_add+0x1a/0x80
 PGD 0
 Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
 Modules linked in: osc(C) lmv(C) fld(C) mgc(C) lustre(C) mdc(C) fid(C) lov(C) ksocklnd(C) ptlrpc(C) obdclass(C) lnet(C) libcfs(C) loop sha512_generic crc32 rpcsec_gss_krb5 microcode joydev i2c_piix4 acpi_cpufreq pcspkr nfsd syscopyarea sysfillrect sysimgblt drm_kms_helper ttm drm serio_raw virtio_blk [last unloaded: libcfs]
 CPU: 0 PID: 13328 Comm: cvs Tainted: G         C      4.2.0-rc1-vm-nfs+ #30
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
 task: ffff8800cc98a400 ti: ffff8801157e8000 task.ti: ffff8801157e8000
 RIP: 0010:[<ffffffff8140d90a>]  [<ffffffff8140d90a>] __percpu_counter_add+0x1a/0x80
 RSP: 0018:ffff8801157eb698  EFLAGS: 00010086
 RAX: 0000000000000003 RBX: ffffea0002b91cc0 RCX: 000000000000001a
 RDX: 0000000000000020 RSI: 0000000000000001 RDI: 00000000000000e8
 RBP: ffff8801157eb6b8 R08: 0000000000000001 R09: 0000000000000000
 R10: 0000000000000000 R11: 0000000000000000 R12: 00000000000000e8
 R13: 0000000000000001 R14: ffff8800673587a8 R15: ffff8800673589b0
 FS:  00007f6718b89800(0000) GS:ffff88011f400000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000138 CR3: 000000009d51c000 CR4: 00000000000007f0
 Stack:
  ffffffff811919e2 ffffea0002b91cc0 ffff880067358998 ffff880119419800
  ffff8801157eb718 ffffffff81191a58 ffff8801157eb788 0000000000000282
  ffff8800ce5ce920 0000000000000000 ffff8800a525af80 ffff880053f68f10
 Call Trace:
  [<ffffffff811919e2>] ? __test_set_page_writeback+0x72/0x240
  [<ffffffff81191a58>] __test_set_page_writeback+0xe8/0x240
  [<ffffffffa04e7a13>] vvp_page_prep_write+0x33/0xb0 [lustre]
  [<ffffffffa028ad87>] cl_page_invoke+0x57/0x90 [obdclass]
  [<ffffffffa028cc8d>] cl_page_prep+0x2d/0x180 [obdclass]
  [<ffffffffa0545d84>] osc_io_submit+0x134/0x4a0 [osc]
  [<ffffffffa02933a3>] cl_io_submit_rw+0x53/0xb0 [obdclass]
  [<ffffffffa0483635>] lov_io_submit+0x3a5/0x570 [lov]
  [<ffffffff810cb7bb>] ? lockdep_init_map+0x5b/0x6d0
  [<ffffffffa02933a3>] cl_io_submit_rw+0x53/0xb0 [obdclass]
  [<ffffffffa029428d>] cl_io_submit_sync+0xed/0x1c0 [obdclass]
  [<ffffffffa04e881d>] vvp_page_sync_io.isra.15+0x4d/0x100 [lustre]
  [<ffffffffa028dd2f>] ? cl_page_clip+0xff/0x130 [obdclass]
  [<ffffffffa04e9f38>] vvp_io_commit_write+0x448/0x500 [lustre]
  [<ffffffffa02939fa>] cl_io_commit_write+0x9a/0x130 [obdclass]
  [<ffffffffa04cb222>] ll_commit_write+0xc2/0x230 [lustre]
  [<ffffffffa04dbdaa>] ll_write_end+0x2a/0x50 [lustre]
  [<ffffffff811851ba>] generic_perform_write+0xfa/0x1b0
  [<ffffffff8121fd2e>] ? dentry_needs_remove_privs.part.16+0x1e/0x30
  [<ffffffff811877d0>] __generic_file_write_iter+0x190/0x1f0
  [<ffffffff8118791a>] generic_file_write_iter+0xea/0x1e0
  [<ffffffffa04e8dd0>] vvp_io_write_start+0xa0/0x1e0 [lustre]
  [<ffffffffa0292469>] cl_io_start+0x49/0x80 [obdclass]
  [<ffffffffa0294803>] cl_io_loop+0x73/0xd0 [obdclass]
  [<ffffffffa04b4ebf>] ll_file_io_generic+0x45f/0x4b0 [lustre]
  [<ffffffffa04b504c>] ll_file_write_iter+0x6c/0xc0 [lustre]
  [<ffffffff8120330a>] __vfs_write+0xaa/0xe0
  [<ffffffff81203969>] vfs_write+0xa9/0x190
  [<ffffffff812046c9>] SyS_write+0x49/0xa0
  [<ffffffff81796572>] entry_SYSCALL_64_fastpath+0x16/0x7a
 Code: 5b 41 5c 41 5d 41 5e 5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 55 41 54 53 49 89 fc 49 89 f5 48 83 ec 08 65 ff 05 8e d1 bf 7e <48> 8b 47 50 48 63 ca 65 8b 18 48 63 db 48 01 f3 48 39 cb 7d 0a

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/15610
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6854
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:03:50 -07:00
Viresh Kumar 208bf77049 staging: lustre: drop redundant check
There is no need to verify that its an error, as we are anyway going to
match the error value to -ENOENT.  Drop the redundant check.

Reported-by: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:03:50 -07:00
Oleg Drokin e56e17ea93 staging/lustre: use ATTR_OPEN directly, remove ATTR_RAW
ATTR_RAW is unused.
No point in redefining ATTR_OPEN as ATTR_FROM_OPEN

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:02:02 -07:00
Oleg Drokin b81f9b6db6 staging/lustre: ATTR_TIMES_SET is always defined, so don't check it
Remove ATTR_TIMES_SET check as it's always present, move
the mask of times define close to where it's used.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31 16:01:59 -07:00