]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/log
mirror_ubuntu-artful-kernel.git
8 years agostaging: lustre: ldlm: move LDLM_GID_ANY to lustre_dlm.h
Jinshan Xiong [Sun, 18 Sep 2016 20:38:32 +0000 (16:38 -0400)]
staging: lustre: ldlm: move LDLM_GID_ANY to lustre_dlm.h

lustre_idl.h only includes wire data; lustre_dlm.h is the
right place for LDLM_GID_ANY.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6028
Reviewed-on: http://review.whamcloud.com/13074
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ptlrpc: fix comparison between signed and unsigned
Dmitry Eremin [Sun, 18 Sep 2016 20:38:31 +0000 (16:38 -0400)]
staging: lustre: ptlrpc: fix comparison between signed and unsigned

Change return type and size argiments of lustre_msg_hdr_size(),
lustre_msg_buf{len,count}() and req_capsule_*_size() to __u32.
Change type of req_format->rf_idx and req_format->rf_fields.nr
to size_t. Also return zero for incorrect message magic instead
of -EINVAL. This will be more robust because of few of them after
LASSERTF(0, "...") and will not be returned. In the rest places
it return zero size instead of huge number after implicit
unsigned conversion.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12475
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: clio: add coo_getstripe interface
Bobi Jam [Sun, 18 Sep 2016 20:38:30 +0000 (16:38 -0400)]
staging: lustre: clio: add coo_getstripe interface

Use cl_object_operations::coo_getstripe() to handle
LL_IOC_LOV_GETSTRIPE ops.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5823
Reviewed-on: http://review.whamcloud.com/12452
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: change cl_fault_io->ft_nob to size_t
Dmitry Eremin [Sun, 18 Sep 2016 20:38:29 +0000 (16:38 -0400)]
staging: lustre: obdclass: change cl_fault_io->ft_nob to size_t

Change the type accordant usage.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12380
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obd: change brw_page->count to unsigned
Dmitry Eremin [Sun, 18 Sep 2016 20:38:28 +0000 (16:38 -0400)]
staging: lustre: obd: change brw_page->count to unsigned

Pages count is unsigned. So, change the type accordant usage.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12378
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: Recalculate interval in ldlm_pool_recalc()
Nathaniel Clark [Sun, 18 Sep 2016 20:38:27 +0000 (16:38 -0400)]
staging: lustre: ldlm: Recalculate interval in ldlm_pool_recalc()

Instead of rechecking a static value, recalculate to see if pool stats
need to be updated.
Add newline so message will print instead of warning about missing
newline.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4536
Reviewed-on: http://review.whamcloud.com/12547
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ptlrpc: Suppress error message when imp_sec is freed
Amir Shehata [Sun, 18 Sep 2016 20:38:26 +0000 (16:38 -0400)]
staging: lustre: ptlrpc: Suppress error message when imp_sec is freed

There is a race condition on client reconnect when the import
is being destroyed.  Some outstanding client bound requests
are being processed when the imp_sec has alread been freed.
Ensure to suppress the error message in import_sec_validate_get()
in that case

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3353
Reviewed-on: http://review.whamcloud.com/10200
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: eliminate NULL error return
Bob Glossman [Sun, 18 Sep 2016 20:38:25 +0000 (16:38 -0400)]
staging: lustre: obdclass: eliminate NULL error return

Always return an ERR_PTR() on errors, never return a NULL,
in lu_object_find_slice().  Also clean up callers who
no longer need special case handling of NULL returns.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5858
Reviewed-on: http://review.whamcloud.com/12554
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: change loop indexes to unsigned
Dmitry Eremin [Sun, 18 Sep 2016 20:38:24 +0000 (16:38 -0400)]
staging: lustre: obdclass: change loop indexes to unsigned

Cleanup warnings about comparison between signed and unsigned.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12387
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fiemap: set FIEMAP_EXTENT_LAST correctly
Bobi Jam [Sun, 18 Sep 2016 20:38:23 +0000 (16:38 -0400)]
staging: lustre: fiemap: set FIEMAP_EXTENT_LAST correctly

When we've collected enough extents as user requested, we'd check one
further to decide whether we've reached the last extent of the file.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5933
Reviewed-on: http://review.whamcloud.com/12781
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: evict clients returning errors on ASTs
Alexey Lyashkov [Sun, 18 Sep 2016 20:38:22 +0000 (16:38 -0400)]
staging: lustre: ldlm: evict clients returning errors on ASTs

To test proper behavior of clients returning errors on ASTs
we can induce a failure with setting OBD_FAIL_LDLM_BL_CALLBACK_NET.
Handle the new additonal case of cfs_fail_err being set as well
so that the cfs_fail_err can be sent back in a reply.

Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5581
Xyratex-bug-id: MRP-2041
Reviewed-on: http://review.whamcloud.com/11752
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: mdc: Proper accessing struct lov_user_md
Yoshifumi Uemura [Sun, 18 Sep 2016 20:38:21 +0000 (16:38 -0400)]
staging: lustre: mdc: Proper accessing struct lov_user_md

In mdc_setattr_pack() access the members of struct lov_user_md by
little endian byte order.

Signed-off-by: Yoshifumi Uemura <kogexe@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5889
Reviewed-on: http://review.whamcloud.com/12683
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: lu_htable_order() return type to long
Dmitry Eremin [Sun, 18 Sep 2016 20:38:20 +0000 (16:38 -0400)]
staging: lustre: obdclass: lu_htable_order() return type to long

Change the type accordant usage.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12385
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: fix dup flags names
Bob Glossman [Sun, 18 Sep 2016 20:38:19 +0000 (16:38 -0400)]
staging: lustre: llite: fix dup flags names

The name 'xattr' is used for two different ll_flags bits.
Change the names to be distinct and different, reflecting
the names of the bits used in LL_SBI_xbitnamex #defines.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5586
Reviewed-on: http://review.whamcloud.com/12892
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llog: prevent out-of-bound index
frank zago [Sun, 18 Sep 2016 20:38:17 +0000 (16:38 -0400)]
staging: lustre: llog: prevent out-of-bound index

llog_process_thread() can be called from llog_cat_process_cb with an
index already out of bound, leading to the following crash:

LustreError: 3773:0:(llog.c:310:llog_process_thread())
  ASSERTION(index <= last_index + 1 ) failed:
LustreError: 3773:0:(llog.c:310:llog_process_thread()) LBUG

 #0 [ffff8801144bf900] machine_kexec at ffffffff81038f3b
 #1 [ffff8801144bf960] crash_kexec at ffffffff810c5d82
 #2 [ffff8801144bfa30] panic at ffffffff8152798a
 #3 [ffff8801144bfab0] lbug_with_loc at ffffffffa02f8eeb [libcfs]
 #4 [ffff8801144bfad0] llog_process_thread at ffffffffa0413fff [obdclass]
 #5 [ffff8801144bfb80] llog_process_or_fork at ffffffffa041585f [obdclass]
 #6 [ffff8801144bfbd0] llog_cat_process_cb at ffffffffa0418612 [obdclass]
 #7 [ffff8801144bfc30] llog_process_thread at ffffffffa0413c22 [obdclass]
 #8 [ffff8801144bfce0] llog_process_or_fork at ffffffffa041585f [obdclass]
 #9 [ffff8801144bfd30] llog_cat_process_or_fork at ffffffffa0416b9d [obdclass]

If index is too big, simply return success.

Signed-off-by: frank zago <fzago@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5635
Reviewed-on: http://review.whamcloud.com/12161
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ptlrpc: quiet errors on initial connection
Andreas Dilger [Sun, 18 Sep 2016 20:38:16 +0000 (16:38 -0400)]
staging: lustre: ptlrpc: quiet errors on initial connection

It may be that a client or MDS is trying to connect to a target (OST
or peer MDT) before that target is finished setup. Rather than
spamming the console logs during initial connection, only print a
console error message if there are repeated failures trying to
connect to the target, which may indicate an error on that node.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3456
Reviewed-on: http://review.whamcloud.com/10057
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: revert the changes for lock canceling policy
Jinshan Xiong [Sun, 18 Sep 2016 20:38:15 +0000 (16:38 -0400)]
staging: lustre: ldlm: revert the changes for lock canceling policy

The changes for LRU lock policy was introduced by commit bfae5a4e,
where I was trying to revise the policy to pick locks for canceling.

However, this caused two problems as mentioned in LU-5727. The first
problem is that the lock can only be picked for canceling only if
the number of LRU locks is over preset LRU number AND it's aged; the
second problem is that mdc_cancel_weight() tends to not cancel OPEN
locks, therefore open locks can be kept forever and finally exhausts
memory on the MDT side.

The commit 7b2d26b0 ("revert changes to ldlm_cancel_aged_policy") fixed
the first problem. This patch will revert the rest of changes related
to LRU policy revise.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5727
Reviewed-on: http://review.whamcloud.com/12733
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: recovery: don't replay closed open
Niu Yawei [Sun, 18 Sep 2016 20:38:14 +0000 (16:38 -0400)]
staging: lustre: recovery: don't replay closed open

To avoid scanning the replay open list every time in the
ptlrpc_free_committed(), the fix of LU-2613 (4322e0f9) changed
the ptlrpc_free_committed() to skip the open list unless the
import generation is changed. That introduced a race which could
make a closed open being replayed:

1. Application calls ll_close_inode_openhandle()-> mdc_close(),
   to close file, rq_replay is cleared, but the open request is
   still on the imp_committed_list;

2. Before the md_clear_open_replay_data() is called for close,
   client start replay, and that closed open will be replayed
   mistakenly;

3. Open replay interpret callback (mdc_replay_open) could race
   with the mdc_clear_open_replay_data() at the end;

This patch fix the ptlrpc_free_committed() to make sure the
open list is scanned on recovery to prevent the closed open request
from being replayed.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5507
Reviewed-on: http://review.whamcloud.com/12667
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: changelog: Proper record remapping
Henri Doreau [Sun, 18 Sep 2016 20:38:13 +0000 (16:38 -0400)]
staging: lustre: changelog: Proper record remapping

Fixed changelog_remap_rec() to correctly remap records emitted
with jobid_var=disabled, i.e. delivered by new servers but with
no jobid field.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5862
Reviewed-on: http://review.whamcloud.com/12574
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Robert Read <robert.read@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: remove ll_objects_destroy()
John L. Hammond [Sun, 18 Sep 2016 20:38:12 +0000 (16:38 -0400)]
staging: lustre: llite: remove ll_objects_destroy()

Remove ll_objects_destroy(). This function is not needed for
interoperability with servers of version 2.4 or higher.

Remove the then unused function lov_destroy() and its supporting
functions. Remove the lsm_destroy method of struct lsm_operations.

Remove the unused struct lov_stripe_md, MD export, and capa parameters
from obd_destroy() and its implementations.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814
Reviewed-on: http://review.whamcloud.com/12618
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: echo: replace lov_stripe_md with lov_oinfo
John L. Hammond [Sun, 18 Sep 2016 20:38:11 +0000 (16:38 -0400)]
staging: lustre: echo: replace lov_stripe_md with lov_oinfo

In echo_client replace uses of struct lov_stripe_md with struct
lov_oinfo (since the instances of the former really only contained a
single instance of the latter). Remove the then unneccessary functions
echo_alloc_memmd(), echo_free_memmd(), osc_unpackmd(), and
obd_alloc_memmd(). Remove the struct lov_stripe_md * parameter from
obd_create().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5418
Reviewed-on: http://review.whamcloud.com/12447
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obd: remove unused obd methods
John L. Hammond [Sun, 18 Sep 2016 20:38:10 +0000 (16:38 -0400)]
staging: lustre: obd: remove unused obd methods

Remove no longer used osc_packmd() and osc_getstripe().
Several ioctls cases that are no longer used are removed.
Remove no longer used adjust_kms() infrastructure.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2785
Reviewed-on: http://review.whamcloud.com/8547
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: statahead: small fixes and cleanup
Lai Siyao [Sun, 18 Sep 2016 20:38:09 +0000 (16:38 -0400)]
staging: lustre: statahead: small fixes and cleanup

small fixes:
 * when 'unplug' is set for ll_statahead(), sa_put() shouldn't kill
   the entry found, because its inflight RPC may not finish yet.
 * remove 'sai_generation', add 'lli_sa_generation' because the
   former one is not safe to access without lock.
 * revalidate_statahead_dentry() may fail to wait for statahead
   entry to become ready, in this case it should not release this
   entry, because it may be used by inflight statahead RPC.

cleanups:
 * rename ll_statahead_enter() to ll_statahead().
 * move dentry 'lld_sa_generation' update to ll_statahead() to
   simplify code and logic.
 * other small cleanups.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3270
Reviewed-on: http://review.whamcloud.com/9667
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6222
Reviewed-on: http://review.whamcloud.com/13708
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix messages with missing newlines
John L. Hammond [Sun, 18 Sep 2016 20:38:08 +0000 (16:38 -0400)]
staging: lustre: fix messages with missing newlines

Restore the trailing newline in the definition of OSC_DUMP_GRANT().
Remove an unnecessary CDEBUG() from ldlm_pool_recalc().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5551
Reviewed-on: http://review.whamcloud.com/11996
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lov: remove unused {get, set}_info handlers
John L. Hammond [Sun, 18 Sep 2016 20:38:07 +0000 (16:38 -0400)]
staging: lustre: lov: remove unused {get, set}_info handlers

In LOV and OSC remove handlers for the obsolete get and set info keys:
KEY_CAPA_KEY, KEY_CONNECT_FLAG, KEY_EVICT_BY_NID, KEY_LAST_ID,
KEY_LOCK_TO_STRIPE, KEY_MDS_CONN, KEY_NEXT_ID.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814
Reviewed-on: http://review.whamcloud.com/12445
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: changelog: fix comparison between signed and unsigned
Dmitry Eremin [Sun, 18 Sep 2016 20:38:06 +0000 (16:38 -0400)]
staging: lustre: changelog: fix comparison between signed and unsigned

Change type of changelog_*{namelen,size}() to size_t.
Fixed string specifier for unsigned types.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12474
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lov: remove LL_IOC_RECREATE_{FID, OBJ}
John L. Hammond [Sun, 18 Sep 2016 20:38:05 +0000 (16:38 -0400)]
staging: lustre: lov: remove LL_IOC_RECREATE_{FID, OBJ}

Remove the obsolete ioctls LL_IOC_RECREATE_FID and LL_IOC_RECREATE_OBJ
along with their handlers in llite. Remove the then unused OBD method
lov_create(). Remove OBD_FL_RECREATE_OBJS handling from osc_create().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5814
Reviewed-on: http://review.whamcloud.com/12442
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: change lu_site->ls_purge_start to unsigned
Dmitry Eremin [Sun, 18 Sep 2016 20:38:04 +0000 (16:38 -0400)]
staging: lustre: obdclass: change lu_site->ls_purge_start to unsigned

Change the type accordant usage.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12384
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lu_dirent_calc_size() return type to size_t
Dmitry Eremin [Sun, 18 Sep 2016 20:38:03 +0000 (16:38 -0400)]
staging: lustre: lu_dirent_calc_size() return type to size_t

Change the type accordant usage.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12383
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: count of pools is unsigned long
Dmitry Eremin [Sun, 18 Sep 2016 20:38:02 +0000 (16:38 -0400)]
staging: lustre: ldlm: count of pools is unsigned long

Function ldlm_pools_count() return unsigned long but counter is int.
Use ldlm_pool_granted() everywhere.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/12304
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: replace direct HZ access with kernel APIs
Jian Yu [Sun, 18 Sep 2016 20:38:01 +0000 (16:38 -0400)]
staging: lustre: replace direct HZ access with kernel APIs

On some customer's systems, kernel was compiled with HZ defined to
100, instead of 1000. This improves performance for HPC applications.
However, to use these systems with Lustre, customers have to re-build
Lustre for the kernel because Lustre directly uses the defined
constant HZ.

Since kernel 2.6.21, some non-HZ dependent timing APIs become non-
inline functions, which can be used in Lustre codes to replace the
direct HZ access.

These kernel APIs include:
  jiffies_to_msecs()
  jiffies_to_usecs()
  jiffies_to_timespec()
  msecs_to_jiffies()
  usecs_to_jiffies()
  timespec_to_jiffies()

And here are some samples of the replacement:
  HZ            -> msecs_to_jiffies(MSEC_PER_SEC)
  n * HZ        -> msecs_to_jiffies(n * MSEC_PER_SEC)
  HZ / n        -> msecs_to_jiffies(MSEC_PER_SEC / n)
  n / HZ        -> jiffies_to_msecs(n) / MSEC_PER_SEC
  n / HZ * 1000 -> jiffies_to_msecs(n)

This patch replaces the direct HZ access in lustre modules.

Signed-off-by: Jian Yu <jian.yu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5443
Reviewed-on: http://review.whamcloud.com/12052
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obd: cleanup struct md_op_data and uses
John L. Hammond [Sun, 18 Sep 2016 20:38:00 +0000 (16:38 -0400)]
staging: lustre: obd: cleanup struct md_op_data and uses

Make the following changes in or around struct md_op_data:

 * rename enum op_cli_flags to enum md_cli_flags.

 * Change to type of the op_flags member from __u32 to enum
   md_op_flags.

 * Remove the used but never set member op_npages.

 * Remove the set but never used member op_stripe_offset (an alias for
   op_ioepoch).

 * Remove the op_max_pages alias for op_valid and add a op_max_pages
   member.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/11734
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: mdc: fix comparison between signed and unsigned
Dmitry Eremin [Sun, 18 Sep 2016 20:37:59 +0000 (16:37 -0400)]
staging: lustre: mdc: fix comparison between signed and unsigned

Change type of client_obd->*_mds_*size from int to __u32 and
argumanets of related create/rename/setattr functions.
Change type of op_data->op_namelen to size_t.
Change type of argument size for all mdc_*_pack() to size_t.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/11379
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: at: net AT after connect
Alexander Boyko [Sun, 18 Sep 2016 20:37:58 +0000 (16:37 -0400)]
staging: lustre: at: net AT after connect

Once connected, the previously gathered AT statistics is not valid
anymore because may reflect other routing, etc. The connect by itself
could take a long time due to different reasons (e.g. server was not
ready) and net latency got very high (see import_select_connection())
what does not reflect the current situation.

Take into account only the current (re-)CONNECT rpc latency.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5380
Xyratex-bug-id: MRP-1285
Reviewed-on: http://review.whamcloud.com/11155
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: statahead: race in start/stop statahead
Lai Siyao [Sun, 18 Sep 2016 20:37:57 +0000 (16:37 -0400)]
staging: lustre: statahead: race in start/stop statahead

When starting statahead thread, it should check whether current
lli_opendir_key was deauthorized in the mean time by another
process.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3270
Reviewed-on: http://review.whamcloud.com/9666
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: statahead: ll_intent_drop_lock() called in spinlock
Lai Siyao [Sun, 18 Sep 2016 20:37:56 +0000 (16:37 -0400)]
staging: lustre: statahead: ll_intent_drop_lock() called in spinlock

ll_intent_drop_lock() may sleep, which should not be called inside
spinlock.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2272
Reviewed-on: http://review.whamcloud.com/9665
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: statahead: use dcache-like interface for sa entry
Lai Siyao [Sun, 18 Sep 2016 20:37:55 +0000 (16:37 -0400)]
staging: lustre: statahead: use dcache-like interface for sa entry

Rename ll_sa_entry to sa_entry, and manage sa_entry cache with
dcache-like interfaces.

sa_entry is not needed to be refcounted, because only scanner
can free it, so after it's put in stat list, statahead thread
shouldn't access it any longer.

ll_statahead_interpret() doesn't need to take sai refcount,
because statahead thread will wait for all inflight RPC to
finish.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3270
Reviewed-on: http://review.whamcloud.com/9664
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: allow setting stripes to specify OSTs
Jinshan Xiong [Sun, 18 Sep 2016 20:37:54 +0000 (16:37 -0400)]
staging: lustre: llite: allow setting stripes to specify OSTs

Extend the llite layer to support specifying individual target
OSTs. Support specifying OSTs for regular files only. Directory
support will be implemented later in a separate project. With
this a file could have for example a OST index layout of
2,4,5,9,11. In addition, duplicate indices will be eliminated
automatically. Calculate the max easize by ld_active_tgt_count
instead of ld_tgt_count. However this may introduce problems
when the OSTs are in recovery because non sufficient buffer
may be allocated to store EA.

Signed-off-by: Jian Yu <jian.yu@intel.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4665
Reviewed-on: http://review.whamcloud.com/9383
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: Add ioctl to get parent fids from link EA.
Henri Doreau [Sun, 18 Sep 2016 20:37:53 +0000 (16:37 -0400)]
staging: lustre: llite: Add ioctl to get parent fids from link EA.

Added LL_IOC_GETPARENT to retrieve the <parent_fid>/name(s) of a given
entry, based on its link EA. This saves multiple calls to
path2fid/fid2path.

Merged with second later patch that does various cleanups.
Avoid unneeded allocation. Get read-only attributes from the user
getparent structure and write the modified attributes only, instead
of populating a whole structure in kernel and copying it back.

Signed-off-by: Thomas Leibovici <thomas.leibovici@cea.fr>
Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3613
Reviewed-on: http://review.whamcloud.com/7069
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5837
Reviewed-on: http://review.whamcloud.com/12527
Reviewed-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obd: restore linkea support
James Simmons [Sun, 18 Sep 2016 20:37:52 +0000 (16:37 -0400)]
staging: lustre: obd: restore linkea support

Original linkea was only used for the lustre server code
so it was removed from the upstream client. Now it needs
to be restored for client work that uses this infrastructure.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: add testing for bad name hash
Fan Yong [Sun, 18 Sep 2016 20:37:51 +0000 (16:37 -0400)]
staging: lustre: lmv: add testing for bad name hash

Enable testing of the lfsck recovery feature in the
client code for the case when name hash for some
entry becomes corrupt.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5519
Reviewed-on: http://review.whamcloud.com/11846
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: ensure all data flush out when umount
Yang Sheng [Sun, 18 Sep 2016 20:37:50 +0000 (16:37 -0400)]
staging: lustre: llite: ensure all data flush out when umount

Write out all extents when clear inode. Otherwise we
may lose data while umount.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5584
Reviewed-on: http://review.whamcloud.com/12103
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: per-export lock callback timeout
Vitaly Fertman [Sun, 18 Sep 2016 20:37:49 +0000 (16:37 -0400)]
staging: lustre: ldlm: per-export lock callback timeout

The lock callback timeout is calculated as an average per namespace.
This does not reflect individual client behavior.
Instead, we should calculate it on a per-export basis.

This is the client side changes for upstream client.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4942
Reviewed-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-by: Alexey Lyashkov <Alexey_Lyashkov@xyratex.com>
Xyratex-bug-id: MRP-417
Reviewed-on: http://review.whamcloud.com/9336
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: move some inline functions to lustre_lmv.h
Fan Yong [Sun, 18 Sep 2016 20:37:48 +0000 (16:37 -0400)]
staging: lustre: lmv: move some inline functions to lustre_lmv.h

Move some inline code out of lmv core into lustre_lmv.h.
This is to prepare for use outside of the lmv layer in
the future of these functions. Change from passing in
struct lmv_stripe_md to just int for lmv_is_known_hash_type.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5519
Reviewed-on: http://review.whamcloud.com/11845
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Flexible changelog format.
Henri Doreau [Sun, 18 Sep 2016 20:37:47 +0000 (16:37 -0400)]
staging: lustre: Flexible changelog format.

Added jobid fields to Changelog records (and extended records). The
CLF_JOBID flags allows to check if the field is present or not (old
format) when reading an entry. Jobids are expressed as 32 chars long,
zero-terminated strings. Updated test_205 in sanity.sh.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1996
Reviewed-on: http://review.whamcloud.com/4060
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: enforce pool name length limit
Li Xi [Sun, 18 Sep 2016 20:37:46 +0000 (16:37 -0400)]
staging: lustre: llite: enforce pool name length limit

The pool related codes have some inconsistency about the length
of pool name. Creating and setting a pool name of length 16
to a directory will succeed. However, creating a file under
that directory will fail.

This patch disables any pool name which is longer or equal to
16. And it changes LOV_MAXPOOLNAME from 16 to 15 which might
cause some invalid LLOG records of OST pools with 16 byte names.
It is not a problem since invalid LLOG records are just ignored.
And OST pools with 16 byte names won't work well anyway on the
old versions. There will be problem of inconsistency if part of
the servers have this patch and part of the servers don't. But
it would be safe to assume that this is not a normal
configuration.

Signed-off-by: Li Xi <lixi@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5054
Reviewed-on: http://review.whamcloud.com/10306
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: handle concurrent use of cob_transient_pages
Stephen Champion [Sun, 18 Sep 2016 20:37:45 +0000 (16:37 -0400)]
staging: lustre: llite: handle concurrent use of cob_transient_pages

With the lockless __generic_file_aio_write introduced in LU-1669,
ll_direct_IO_26 is no longer protected by the inode i_isem.

This renders obsoltete checks that all transient pages have been
handled before and after entry, and requires atomic access to their
counter.

Signed-off-by: Stephen Champion <schamp@sgi.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5700
Reviewed-on: http://review.whamcloud.com/12179
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: remove dead code
Dmitry Eremin [Sun, 18 Sep 2016 20:37:44 +0000 (16:37 -0400)]
staging: lustre: lmv: remove dead code

The member lmv_obd->server_timeout and function lmv_set_timeouts()
are not used.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-991
Reviewed-on: http://review.whamcloud.com/11880
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: misc: Reduce exposure to overflow on page counters.
Stephen Champion [Sun, 18 Sep 2016 20:37:43 +0000 (16:37 -0400)]
staging: lustre: misc: Reduce exposure to overflow on page counters.

When the number of an object in use or circulation is tied to memory
size of the system, very large memory systems can overflow 32 bit
counters.  This patch addresses overflow on page counters in the osc LRU
and obd accounting.

Signed-off-by: Stephen Champion <schamp@sgi.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4856
Reviewed-on: http://review.whamcloud.com/10537
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: change type of lmv_obd->tgts_size to u32
Dmitry Eremin [Sun, 18 Sep 2016 20:37:42 +0000 (16:37 -0400)]
staging: lustre: lmv: change type of lmv_obd->tgts_size to u32

tgts_size is used as unsigned.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/11881
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obd: change type of lmv_tgt_desc->ltd_idx to u32
Dmitry Eremin [Sun, 18 Sep 2016 20:37:41 +0000 (16:37 -0400)]
staging: lustre: obd: change type of lmv_tgt_desc->ltd_idx to u32

ltd_idx is used as unsigned.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/11879
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: don't call make_bad_inode() on an old inode
John L. Hammond [Sun, 18 Sep 2016 20:37:40 +0000 (16:37 -0400)]
staging: lustre: llite: don't call make_bad_inode() on an old inode

In ll_iget() if ll_update_inode() fails then do not call
make_bad_inode() on the inode since it may still be in use.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5468
Reviewed-on: http://review.whamcloud.com/11609
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obd: rename LUSTRE_STRIPE_MAXBYTES
John L. Hammond [Sun, 18 Sep 2016 20:37:39 +0000 (16:37 -0400)]
staging: lustre: obd: rename LUSTRE_STRIPE_MAXBYTES

Rename LUSTRE_STRIPE_MAXBYTES to LUSTRE_EXT3_STRIPE_MAXBYTES and
correct the comment describing its use.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/11800
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: remove lustre_lite.h
John L. Hammond [Sun, 18 Sep 2016 20:37:38 +0000 (16:37 -0400)]
staging: lustre: remove lustre_lite.h

Move several definition only used in lustre/llite/ to
lustre/llite/llite_internal.h.
Remove lustre/include/{,linux/}lustre_lite.h and fixup
the missing includes in other headers that this exposes.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/11501
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: osc: debug to match extent to brw RPC
Patrick Farrell [Sun, 18 Sep 2016 20:37:37 +0000 (16:37 -0400)]
staging: lustre: osc: debug to match extent to brw RPC

Currently, it's difficult to match brw RPCs to objects and
extents from client logs.  This patch adds a D_RPCTRACE
debug message giving the necessary information.

Signed-off-by: Patrick Farrell <paf@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5531
Reviewed-on: http://review.whamcloud.com/11548
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@seagate.com>
Reviewed-by: Ann Koehler <amk@cray.com>
Reviewed-by: Ryan Haasken <haasken@cray.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: cleanup lustre_lib.h
John L. Hammond [Sun, 18 Sep 2016 20:37:36 +0000 (16:37 -0400)]
staging: lustre: cleanup lustre_lib.h

Remove some unused declarations from lustre_lib.h and move
some others to more natural headers.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/11500
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: no need to check dentry is NULL
John L. Hammond [Sun, 18 Sep 2016 20:37:35 +0000 (16:37 -0400)]
staging: lustre: llite: no need to check dentry is NULL

We are already touching dentry in CDEBUG macros so it
will crash long before these checks. Since this is the
case no need to do an additional check.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/10769
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: style cleanup for ll_mkdir
John L. Hammond [Sun, 18 Sep 2016 20:37:34 +0000 (16:37 -0400)]
staging: lustre: llite: style cleanup for ll_mkdir

Style cleanup to make the code readable.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/10769
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: turn mode to umode_t for ll_new_inode()
John L. Hammond [Sun, 18 Sep 2016 20:37:33 +0000 (16:37 -0400)]
staging: lustre: llite: turn mode to umode_t for ll_new_inode()

Change int mode to umode_t.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/10769
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: remove mode from ll_create_it()
John L. Hammond [Sun, 18 Sep 2016 20:37:32 +0000 (16:37 -0400)]
staging: lustre: llite: remove mode from ll_create_it()

Remove the unused mode parameter from ll_create_it().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/10769
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: remove lookup_flags from ll_lookup_it()
John L. Hammond [Sun, 18 Sep 2016 20:37:31 +0000 (16:37 -0400)]
staging: lustre: llite: remove lookup_flags from ll_lookup_it()

Remove the effectively unused lookup_flags parameter from
ll_lookup_it().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/10769
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: vvp: Use lockless __generic_file_aio_write
Prakash Surya [Sun, 18 Sep 2016 20:37:30 +0000 (16:37 -0400)]
staging: lustre: vvp: Use lockless __generic_file_aio_write

Testing multi-threaded single shard file write performance has shown
the inode mutex to be a limiting factor when using the
generic_file_write_iter function. To work around this bottle neck, this
change replaces the locked version of that call with the lock less
version, specifically, __generic_file_write_iter.

In order to maintain posix consistency, Lustre must now employ it's
own locking mechanism in the higher layers. Currently writes are
protected using the lli_write_mutex in the ll_inode_info structure.
To protect against simultaneous write and truncate operations, since
we no longer take the inode mutex during writes, we must down the
lli_trunc_sem semaphore.

Unfortunately, this change by itself does not garner any performance
benefits. Using FIO on a single machine with 32 GB of RAM, write
performance tests were ran with and without this change applied; the
results are below:

    +---------+-----------+---------+--------+--------+
    |     fio v2.0.13     |   Write Bandwidth (KB/s)  |
    +---------+-----------+---------+--------+--------+
    | # Tasks | GB / Task | Test 1  | Test 2 | Test 3 |
    +---------+-----------+---------+--------+--------+
    |    1    |    64     |  452446 | 454623 | 457653 |
    |    2    |    32     |  850318 | 565373 | 602498 |
    |    4    |    16     | 1058900 | 463546 | 529107 |
    |    8    |     8     | 1026300 | 468190 | 576451 |
    |   16    |     4     | 1065500 | 503160 | 462902 |
    |   32    |     2     | 1068600 | 462228 | 466963 |
    |   64    |     1     |  991830 | 556618 | 557863 |
    +---------+-----------+---------+--------+--------+

 * Test 1: Lustre client running 04ec54f. File per process write
           workload. This test was used as a baseline for what we
           _could_ achieve in the single shared file tests if the
           bottle necks were removed.

 * Test 2: Lustre client running 04ec54f. Single shared file
           workload, each task writing to a unique region.

 * Test 3: Lustre client running 04ec54f + this patch. Single shared
           file workload, each task writing to a unique region.

In order to garner any real performance benefits out of a single
shared file workload, the lli_write_mutex needs to be broken up into a
range lock. That would allow write operations to unique regions of a
file to be executed concurrently. This work is left to be done in a
follow up patch.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1669
Reviewed-on: http://review.whamcloud.com/6672
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: Replace write mutex with range lock
Prakash Surya [Sun, 18 Sep 2016 20:37:29 +0000 (16:37 -0400)]
staging: lustre: llite: Replace write mutex with range lock

Testing has shown the ll_inode_inode's lli_write_mutex to be a
limiting factor with single shared file write performance, when using
many writing threads on a single machine. Even if each thread is
writing to a unique portion of the file, the lli_write_mutex will
prevent no more than a single thread to ever write to the file
simultaneously.

This change attempts to remove this bottle neck, by replacing this
mutex with a range lock. This should allow multiple threads to write
to a single file simultaneously iff the threads are writing to unique
regions of the file.

Performance testing shows this change to garner a significant
performance boost to write bandwidth. Using FIO on a single machine
with 32 GB of RAM, write performance tests were run with and without
this change applied; the results are below:

    +---------+-----------+---------+--------+--------+--------+
    |     fio v2.0.13     |        Write Bandwidth (KB/s)      |
    +---------+-----------+---------+--------+--------+--------+
    | # Tasks | GB / Task | Test 1  | Test 2 | Test 3 | Test 4 |
    +---------+-----------+---------+--------+--------+--------+
    |    1    |    64     |  452446 | 454623 | 457653 | 463737 |
    |    2    |    32     |  850318 | 565373 | 602498 | 733027 |
    |    4    |    16     | 1058900 | 463546 | 529107 | 976284 |
    |    8    |     8     | 1026300 | 468190 | 576451 | 963404 |
    |   16    |     4     | 1065500 | 503160 | 462902 | 830065 |
    |   32    |     2     | 1068600 | 462228 | 466963 | 749733 |
    |   64    |     1     |  991830 | 556618 | 557863 | 710912 |
    +---------+-----------+---------+--------+--------+--------+

 * Test 1: Lustre client running 04ec54f. File per process write
           workload. This test was used as a baseline for what we
           _could_ achieve in the single shared file tests if the
           bottle necks were removed.

 * Test 2: Lustre client running 04ec54f. Single shared file
           workload, each task writing to a unique region.

 * Test 3: Lustre client running 04ec54f + I0023132b. Single shared
           file workload, each task writing to a unique region.

 * Test 4: Lustre client running 04ec54f + this patch.
           Single shared file workload, each task writing to a unique
           region.

Direct IO does not use the page cache like normal IO, so
concurrent direct IO reads of the same pages are not safe.

As a result, direct IO reads must take the range lock
in ll_file_io_generic, otherwise they will attempt to work
on the same pages and hit assertions like:
(osc_request.c:1219:osc_brw_prep_request())
ASSERTION( i == 0 || pg->off > pg_prev->off ) failed:
i 3 p_c 10 pg ffffea00017a5208 [pri 0 ind 2771] off 16384
prev_pg ffffea00017a51d0 [pri 0 ind 2256] off 16384

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Patrick Farrell <paf@cray.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1669
Reviewed-on: http://review.whamcloud.com/6320
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6227
Reviewed-on: http://review.whamcloud.com/14385
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Alexander Boyko <alexander.boyko@seagate.com>
Reviewed-by: Hiroya Nozaki <nozaki.hiroya@jp.fujitsu.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: restore some of the interval functionality
James Simmons [Sun, 18 Sep 2016 20:37:28 +0000 (16:37 -0400)]
staging: lustre: ldlm: restore some of the interval functionality

Earlier a bunch of interval handling got removed since it wasn't
used by the upstream client. Now some of it is needed again for
the client code so this patch restores what is needed.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: resend AST callbacks
Vitaly Fertman [Sun, 18 Sep 2016 20:37:27 +0000 (16:37 -0400)]
staging: lustre: ldlm: resend AST callbacks

While clients will resend client->server RPCs, servers would not
resend server->client RPCs such as LDLM callbacks (blocking
or completion callbacks/ASTs).  This could result in clients being
evicted from the server if blocking callbacks were dropped by the
network (a failed router or lossy network) and the client did not
cancel the requested lock in time.
In order to fix this problem, this patch adds the ability to resend
LDLM callbacks from the server and give the client a chance to
respond within the timeout period before it is evicted:

 - resend BL AST within lock callback timeout period;
 - still do not resend CANCEL_ON_BLOCK;
 - regular resend for CP AST without BL AST embedded;
 - prolong lock callback timeout on resend;

some fixes:
 - recovery-small test_10 to actually evict the client
   with dropped BL AST;
 - ETIMEDOUT to be returned if send limit is expired;

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5520
Reviewed-by: Alexey Lyashkov <Alexey_Lyashkov@xyratex.com>
Reviewed-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Xyratex-bug-id: MRP-417
Reviewed-on: http://review.whamcloud.com/9335
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: reconstruct proper flags on enqueue resend
Vitaly Fertman [Sun, 18 Sep 2016 20:37:26 +0000 (16:37 -0400)]
staging: lustre: ldlm: reconstruct proper flags on enqueue resend

otherwise, waiting lock may get granted as no BLOCKED_GRANTED
flag is returned

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Xyratex-bug-id: MRP-1944
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5496
Reviewed-on: http://review.whamcloud.com/11644
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: statahead: statahead thread wait for RPCs to finish
Lai Siyao [Sun, 18 Sep 2016 20:37:25 +0000 (16:37 -0400)]
staging: lustre: statahead: statahead thread wait for RPCs to finish

Statahead thread should wait for inflight stat RPCs to finish in
case statahead RPC callback may access data allocated in statahead
thread context.

ll_sa_entry_fini() should keep old entry if stat RPC is not
finished yet.

Simplify sai refcounting:
* newly allocated sai will hold one refcount, and it will put it
  after starting statahead thread.
* statahead thread holds one refcount.
* agl thread holds one refcount.
* stat process calls do_statahead_enter() which will try to get
  sai, and if it's valid, it will revalidate from statahead cache,
  and put refcount after use.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3270
Reviewed-on: http://review.whamcloud.com/9663
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: Compare of unsigned value against 0 is always true
Dmitry Eremin [Sun, 18 Sep 2016 20:37:24 +0000 (16:37 -0400)]
staging: lustre: llite: Compare of unsigned value against 0 is always true

Comparison of unsigned value against 0 is always true.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5200
Reviewed-on: http://review.whamcloud.com/11217
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: remove RCU2HANDLE macro
John L. Hammond [Sun, 18 Sep 2016 20:37:23 +0000 (16:37 -0400)]
staging: lustre: remove RCU2HANDLE macro

Remove RCU2HANDLE macro from lustre_handles.h.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/11498
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: mdc: Report D_CHANGELOG messages as D_HSM
Henri Doreau [Sun, 18 Sep 2016 20:37:22 +0000 (16:37 -0400)]
staging: lustre: mdc: Report D_CHANGELOG messages as D_HSM

Removed the D_CHANGELOG pseudo-debug flag that wasn't actually defined
as a usable one. Report the D_CHANGELOG messages as D_HSM ones instead
since this is the primary user of these messages.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5538
Reviewed-on: http://review.whamcloud.com/11558
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llog: add newly opened llog at tail of handle list
Li Xi [Sun, 18 Sep 2016 20:37:21 +0000 (16:37 -0400)]
staging: lustre: llog: add newly opened llog at tail of handle list

Add newly opened llog handle at the tail of handle list to increase
lookup speed, especially for cancel operation, because the canceled
log will be removed from the list, and lookup is from the beginning.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Signed-off-by: Li Xi <lixi@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5405
Reviewed-on: http://review.whamcloud.com/11575
Reviewed-by: Ian Costello <costello.ian@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: build: bump build version warnings to x.y.53
Andreas Dilger [Sun, 18 Sep 2016 20:37:20 +0000 (16:37 -0400)]
staging: lustre: build: bump build version warnings to x.y.53

Move the LUSTRE_VERSION_CODE checks to trigger on x.y.53 instead of
x.y.50, so that it is into the development cycle that they are hit
instead of right at the start.

In many cases, the #warning has been removed (to prevent build errors)
and instead the code is just disabled outright.  The dead code can be
seen easily and removed in the future with less interruption to the
development process.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4217
Reviewed-on: http://review.whamcloud.com/8630
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: release request in lmv_revalidate_slaves()
John L. Hammond [Sun, 18 Sep 2016 20:37:19 +0000 (16:37 -0400)]
staging: lustre: lmv: release request in lmv_revalidate_slaves()

In lmv_revalidate_slaves() ensure that the request returned by
md_intent_lock() is properly released on all paths.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5452
Reviewed-on: http://review.whamcloud.com/11326
Reviewed-by: wang di <di.wang@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ptlrpc: fix magic return value of ptlrpc_init_portals
Wang Shilong [Sun, 18 Sep 2016 20:37:18 +0000 (16:37 -0400)]
staging: lustre: ptlrpc: fix magic return value of ptlrpc_init_portals

Previously, when running 'modprobe lustre', it hit the following
error message which is becaue of network initialisation failure:
modprobe: ERROR: could not insert 'lustre': Input/output error

However, error code is there, just let it return to caller,
after this patch, error message will be something like:
modprobe: ERROR: could not insert 'lustre': Network is down

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5455
Reviewed-on: http://review.whamcloud.com/11337
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: fix comparison between signed and unsigned
Dmitry Eremin [Sun, 18 Sep 2016 20:37:17 +0000 (16:37 -0400)]
staging: lustre: obdclass: fix comparison between signed and unsigned

Make lu_buf->lb_len unsigned.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5417
Reviewed-on: http://review.whamcloud.com/11281
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lov: adjust page bufsize after layout change
Jinshan Xiong [Sun, 18 Sep 2016 20:37:16 +0000 (16:37 -0400)]
staging: lustre: lov: adjust page bufsize after layout change

Otherwise, the coh_page_bufsize keeps increasing when the file's
layout keeps changing in lov_init_raid0().

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5459
Reviewed-on: http://review.whamcloud.com/11394
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix comparison between signed and unsigned
Dmitry Eremin [Sun, 18 Sep 2016 20:37:15 +0000 (16:37 -0400)]
staging: lustre: fix comparison between signed and unsigned

Cleanup in general headers.
* use size_t in cfs_size_round*()
* make unsigned index and len in lustre_cfg_*()
* make iteration variable the same type as comparing value
* make unsigned pages counters

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5417
Reviewed-on: http://review.whamcloud.com/11327
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: clio: lu_ref_del() mismatch ref add scope
Bobi Jam [Sun, 18 Sep 2016 20:37:14 +0000 (16:37 -0400)]
staging: lustre: clio: lu_ref_del() mismatch ref add scope

'commit 77605e41a26f ("staging/lustre/clio: add pages into writeback cache
in batches")' adds a page to a list aggregate issuing them to writeback
cache; A page add is referenced in llite/vvp io scope, while writeback
cache commit de-refers it under osc sub io scope, and enabling -lu_ref
will detect this scope mismatch.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4503
Reviewed-on: http://review.whamcloud.com/8970
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: release locks if lmv_intent_lock() fails
John L. Hammond [Sun, 18 Sep 2016 20:37:13 +0000 (16:37 -0400)]
staging: lustre: lmv: release locks if lmv_intent_lock() fails

In lmv_intent_lock() if we will return an error then first release any
locks referenced by the intent.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5431
Reviewed-on: http://review.whamcloud.com/11319
Reviewed-by: wang di <di.wang@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: osc: update kms in brw_interpret() properly
Niu Yawei [Sun, 18 Sep 2016 20:37:12 +0000 (16:37 -0400)]
staging: lustre: osc: update kms in brw_interpret() properly

In brw_interpret(), we forgot page offset when calculating
write offset, that leads to wrong kms for sync write.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5463
Reviewed-on: http://review.whamcloud.com/11374
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Li Dongyang <dongyang.li@anu.edu.au>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: fix some byte order issues
John L. Hammond [Sun, 18 Sep 2016 20:37:11 +0000 (16:37 -0400)]
staging: lustre: lmv: fix some byte order issues

In the handler for LL_IOC_LMV_GETSTRIPE convert stripe FIDs from
little to CPU endian when unpacking lmv_user_md. In lmv_unpack_md_v1()
fix a double conversion of the stripe count.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5342
Reviewed-on: http://review.whamcloud.com/11106
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: update ras stride offset
Bobi Jam [Sun, 18 Sep 2016 20:37:10 +0000 (16:37 -0400)]
staging: lustre: llite: update ras stride offset

When a read ahead does not reach the end of the region reserved from
ras, we'd set ras::ras_next_readahead back to where we left off; For
stride read ahead, it needs to make sure that the offset is no less
than ras_stride_offset, so that the stride read ahead can work
correctly.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5263
Reviewed-on: http://review.whamcloud.com/11181
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: wang di <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: add LL_LEASE_{RD,WR,UN}LCK
John L. Hammond [Sun, 18 Sep 2016 20:37:09 +0000 (16:37 -0400)]
staging: lustre: llite: add LL_LEASE_{RD,WR,UN}LCK

Define new constants LL_LEASE_{RD,WR,UN}LCK for use as the argument to
and return value from the LL_IOC_{GET,SET}_LEASE ioctls. As arguments,
these contants replace the use of F_{RD,WR,UN}LCK from fcntl.h. As
return values they replace the use of FMODE_{READ,WRITE} which are
internal to the Linux kernel source and not under the control of the
Lustre ioctl interface.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5013
Reviewed-on: http://review.whamcloud.com/10233
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: serialize lu_site purge
Niu Yawei [Sun, 18 Sep 2016 20:37:08 +0000 (16:37 -0400)]
staging: lustre: obdclass: serialize lu_site purge

Umount process relies on lu_site_purge(-1) to purge all
objects before umount, however, if there happen to have a
cache shrinker which calls lu_site_purge(nr) in parallel,
some objects may still being freed by cache shrinker even
after the lu_site_purge(-1) called by umount done.

This can be simply fixed by serializing purge threads,
since it doesn't make any sense to have them in parallel.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5331
Reviewed-on: http://review.whamcloud.com/11099
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obd: add rnb_ prefix to struct niobuf_remote members
John L. Hammond [Sun, 18 Sep 2016 20:37:07 +0000 (16:37 -0400)]
staging: lustre: obd: add rnb_ prefix to struct niobuf_remote members

Add the prefix rnb_ to the members of struct niobuf_remote. Delete the
relevant compat macros from ofd_internal.h.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5061
Reviewed-on: http://review.whamcloud.com/10452
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obd: add lnb_ prefix to members of struct niobuf_local
John L. Hammond [Sun, 18 Sep 2016 20:37:06 +0000 (16:37 -0400)]
staging: lustre: obd: add lnb_ prefix to members of struct niobuf_local

Add the prefix lnb_ to the members of struct niobuf_local that do not
already have it. Change the struct dentry *lnb_dentry member to void
*lnb_data as it is not used to hold a pointer to struct dentry.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5061
Reviewed-on: http://review.whamcloud.com/10451
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: Do not ignore ENOENT in lmv_unlink
wang di [Sun, 18 Sep 2016 20:37:05 +0000 (16:37 -0400)]
staging: lustre: lmv: Do not ignore ENOENT in lmv_unlink

Return correct value (rc) in lmv_unlink. In lmv_unlink,
-ENOENT might be ingored for local directory unlink.

Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5371
Reviewed-on: http://review.whamcloud.com/11170
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: obdclass: optimize busy loop wait
Alexander Zarochentsev [Sun, 18 Sep 2016 20:37:04 +0000 (16:37 -0400)]
staging: lustre: obdclass: optimize busy loop wait

two optimizations in the busy loop wait in class_cleanup():
(1) remove unnecessary spinlocks protecting obd_conn_inprogress
    access
(2) replace cond_resched by more suitable yield to unconditionally
    yield the CPU if the condition check fails.

Signed-off-by: Alexander Zarochentsev <alexander_zarochentsev@xyratex.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5397
Xyratex-bug-id: MRP-1991
Reviewed-on: http://review.whamcloud.com/11198
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lmv: honor MDT index when creating volatile file
wang di [Sun, 18 Sep 2016 20:37:03 +0000 (16:37 -0400)]
staging: lustre: lmv: honor MDT index when creating volatile file

LMV should honor MDT index embedded in the name of volatile
file, then during hsm restore, the file under striped dir can
be restored to the right MDT.

Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4691
Reviewed-on: http://review.whamcloud.com/10866
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ldlm: fix a use after free in ldlm_resource_get()
John L. Hammond [Sun, 18 Sep 2016 20:37:02 +0000 (16:37 -0400)]
staging: lustre: ldlm: fix a use after free in ldlm_resource_get()

If lvbo initialization has failed then save the return status (from
lr_lvb_len) before putting the resource.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5305
Reviewed-on: http://review.whamcloud.com/11017
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: ptlrpc: enlarge OST_MAXREQSIZE for 4MB RPC
Li Xi [Sun, 18 Sep 2016 20:37:01 +0000 (16:37 -0400)]
staging: lustre: ptlrpc: enlarge OST_MAXREQSIZE for 4MB RPC

This patch enlarges OST_MAXREQSIZE so as to make the
request size large enough for 4MB RPC.

Signed-off-by: Li Xi <lixi@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4755
Reviewed-on: http://review.whamcloud.com/9599
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: llite: fix ll_statahead_thread() problems on failure
Li Xi [Sun, 18 Sep 2016 20:37:00 +0000 (16:37 -0400)]
staging: lustre: llite: fix ll_statahead_thread() problems on failure

When ll_prep_md_op_data() fails, ll_statahead_thread() does not
release reference of sai and parent dentry. It does not wake
up parent thread either. This patch fixes these problems.

Signed-off-by: Li Xi <lixi@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5274
Reviewed-on: http://review.whamcloud.com/10940
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoRevert "staging: olpc_dcon: Replace a bit shift by a use of BIT."
Greg Kroah-Hartman [Sun, 18 Sep 2016 11:09:50 +0000 (13:09 +0200)]
Revert "staging: olpc_dcon: Replace a bit shift by a use of BIT."

This reverts commit ed88363e6aebb91df820e1a8898d2a07b18d2bc9.

It was incorrect :(

Cc: Anchal Jain <anchalj109@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: device_main: Replace NULL comparison with !x
Namrata A Shettar [Sun, 18 Sep 2016 09:04:51 +0000 (14:34 +0530)]
staging: vt6655: device_main: Replace NULL comparison with !x

Replace NULL comparison to resolve checkpatch issue.
- x == NULL => !x

Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: device_main: Replace explicit NULL comparison
Namrata A Shettar [Sun, 18 Sep 2016 09:05:13 +0000 (14:35 +0530)]
staging: vt6655: device_main: Replace explicit NULL comparison

Replace NULL comparison to resolve checkpatch issue.
- x == NULL => !x

Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wlan-ng: Remove the typedef to the 'wlandevice' structure
sayli karnik [Sun, 18 Sep 2016 09:41:14 +0000 (15:11 +0530)]
staging: wlan-ng: Remove the typedef to the 'wlandevice' structure

This patch removes the typedef 'wlandevice_t' to the 'wlandevice'
structure.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: ks7010: Drop memory allocation cast.
Sandhya Bankar [Sat, 17 Sep 2016 23:25:26 +0000 (04:55 +0530)]
Staging: ks7010: Drop memory allocation cast.

Drop cast on the result of kzalloc.

The semantic patch that makes this change is as follows:

@@
type T;
@@
- (T *)
  (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
   kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: fbtft: Use !x instead of x == NULL.
Sandhya Bankar [Sat, 17 Sep 2016 23:11:39 +0000 (04:41 +0530)]
Staging: fbtft: Use !x instead of x == NULL.

Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: lmv_obd: Remove redundant if-statement.
Sandhya Bankar [Sat, 17 Sep 2016 22:59:54 +0000 (04:29 +0530)]
Staging: lustre: lmv_obd: Remove redundant if-statement.

Remove redundant if-statement.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rtl8192e: Use !x instead of x == NULL
Sandhya Bankar [Sat, 17 Sep 2016 22:48:22 +0000 (04:18 +0530)]
Staging: rtl8192e: Use !x instead of x == NULL

Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>