Whamcloud - gitweb
fs/lustre-release.git
20 months agoLU-13004 lnet: merge lnet_md_alloc into lnet_md_build. 41/37841/8
Mr NeilBrown [Wed, 4 Dec 2019 03:23:58 +0000 (14:23 +1100)]
LU-13004 lnet: merge lnet_md_alloc into lnet_md_build.

lnet_md_alloc is only called twice, each time immediately before a
call to lnet_md_build(), and these are the only calls to
lnet_md_build().

So simplify the code by merging lnet_md_alloc into lnet_md_build.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I13de6d2b225052832d86d4ebe5bf9c2eae945720
Reviewed-on: https://review.whamcloud.com/37841
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
20 months agoLU-13431 llite: rework preferred IO size 76/38176/2
Sebastien Buisson [Tue, 7 Apr 2020 13:34:50 +0000 (13:34 +0000)]
LU-13431 llite: rework preferred IO size

Instead of using inode->i_blkbits to infer preferred IO size,
just set stat->blksize to the right value in ll_getattr_dentry().

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: If705c7d52bdfabdd3e669ca2d34f8cc0ca1ae08a
Reviewed-on: https://review.whamcloud.com/38176
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
20 months agoLU-12043 llite: fix to submit complete read block with ra disabled 17/35217/11
Wang Shilong [Thu, 13 Jun 2019 00:25:47 +0000 (08:25 +0800)]
LU-12043 llite: fix to submit complete read block with ra disabled

Even if readahead disabled, we need to make first cache-miss read
cover current read. Otherwise, without readahead, we are
always sending 1 page RPC which makes performances really bad.

Benchmarked with following command:

iozone -w -c -i 5 -t1 -j 2 -s 100m -r 1m data

Without patch: 39917.20 kB/sec
read write
pages per rpc         rpcs   % cum % |       rpcs   % cum %
1:      25088 100 100   |          0   0   0

With patch: 754811.62 kB/sec
read write
pages per rpc         rpcs   % cum % |       rpcs   % cum %
1:          0   0   0   |          0   0   0
2:          0   0   0   |          0   0   0
4:          0   0   0   |          0   0   0
8:          0   0   0   |          0   0   0
16:          0   0   0   |          0   0   0
32:          0   0   0   |          0   0   0
64:          0   0   0   |          0   0   0
128:          0   0   0   |          0   0   0
256:         98 100 100   |          0   0   0

We got huge peformances up x17 performances up, this is really
expected behavior without RA since we don't readahead any extra
pages, we just send RPC with one transfer size once rather than
send page by page, this help several cases that i could think of:

1) make more sense to compare RA without RA performances, for example
overhead of RA.

2)we could get better performances with multiple thread read same
file without RA.

Same test with RA enabled: 737746.56 kB/sec
read write
pages per rpc         rpcs   % cum % |       rpcs   % cum %
1:          0   0   0   |          0   0   0
2:          0   0   0   |          0   0   0
4:          0   0   0   |          0   0   0
8:          0   0   0   |          0   0   0
16:          0   0   0   |          0   0   0
32:          0   0   0   |          0   0   0
64:          0   0   0   |          0   0   0
128:          0   0   0   |          0   0   0
256:          0   0   0   |          0   0   0
512:          6  10  10   |          0   0   0
1024:         52  89 100   |          0   0   0

Change-Id: I95511fb371912a47d0b566f64a524f3a7500421c
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/35217
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
20 months agoLU-6142 fid: Fix style issues for fid_handler.c 71/38271/2
Arshad Hussain [Sun, 12 Apr 2020 08:13:52 +0000 (13:43 +0530)]
LU-6142 fid: Fix style issues for fid_handler.c

This patch fixes issues reported by checkpatch
for file lustre/fid/fid_handler.c

Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.super@gmail.com>
Change-Id: I78291185d592a04e457ad6fd5fb2964c27e08733
Reviewed-on: https://review.whamcloud.com/38271
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
20 months agoLU-13454 lnet: Handle health stats for reply to optimized GET 37/38237/2
Chris Horn [Tue, 14 Apr 2020 19:00:27 +0000 (14:00 -0500)]
LU-13454 lnet: Handle health stats for reply to optimized GET

The LNet messages used for replies to optimized GETs, created via
lnet_create_reply_msg(), are only ever committed for rx. As such,
their msg_txni and msg_txpeer fields are NULL. lnet_incr_hstats()
does not account for this situation, so when passed one of these
messages attempts to deref a NULL pointer.

HPE-bug-id: LUS-8730
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I36b7c46a2d439c5e62f17df64a4f9da8f01090aa
Reviewed-on: https://review.whamcloud.com/38237
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
20 months agoLU-12506 mdc: clean up code style for mdc_locks.c 17/37917/11
Andreas Dilger [Sat, 14 Mar 2020 02:22:01 +0000 (20:22 -0600)]
LU-12506 mdc: clean up code style for mdc_locks.c

Clean up code style in mdc_locks.c (whitespace, strings)

Run a useful test while we are at it.

Test-Parameters: trivial testlist=runtests mdscount=10 mdtcount=80
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I3e3e0a6a4712e8bc85c93c0a182afa00433ebbe5
Reviewed-on: https://review.whamcloud.com/37917
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
20 months agoLU-11269 ptlrpc: request's counter in import 22/37722/21
Alex Zhuravlev [Tue, 25 Feb 2020 16:44:18 +0000 (19:44 +0300)]
LU-11269 ptlrpc: request's counter in import

which is separate from imp_refcount as the latter can be
used for other purposes and it's hard to use to track
requests.

to verify the theory that imp_refcount should be checked.

Change-Id: I7c273a73e2b1bb43059c7ed003ee2b7d09273bfe
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37722
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
20 months agoLU-10391 lnet: change lnet_sock_connect to take sockaddr 03/37703/6
Mr NeilBrown [Fri, 7 Feb 2020 02:05:57 +0000 (13:05 +1100)]
LU-10391 lnet: change lnet_sock_connect to take sockaddr

Rather than passing a u32 IPv4 address plus port to
lnet_sock_connect() pass a 'struct sockaddr'.  This will allow IPv6
addresses to be requested.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I83ba37bcaade4a84cbce47d93f02043d038c5b29
Reviewed-on: https://review.whamcloud.com/37703
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
20 months agoLU-11025 dne: refactor dir migration 12/37712/7
Lai Siyao [Sat, 15 Feb 2020 13:26:36 +0000 (21:26 +0800)]
LU-11025 dne: refactor dir migration

Tidy up directory migration to make it easier to support
directory restripe.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ibad46d8cf8f984e5f0062792c651b9753c2fb9a6
Reviewed-on: https://review.whamcloud.com/37712
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
20 months agoLU-9019 obd: express timeouts in timeout_t 76/31576/24
James Simmons [Wed, 22 Apr 2020 14:13:45 +0000 (10:13 -0400)]
LU-9019 obd: express timeouts in timeout_t

In the latest kernels time_t has been removed since time_t has
been a 64 bit value just like time64_t so no need for it anymore.
To avoid confusion between timestamps and timeout values Lustre
has a timeout_t typedef which is in seconds and is a s32 since
timeouts are generally short. This helps to avoid errors that
has happens in the past with certain math operation between
timeouts and timestamps that lead to overflow and underflow
cases.

Change-Id: I4524456d514561e145201079a420ff89fa829602
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/31576
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
20 months agoLU-13424 mdt: fix DOM entry check 57/38257/3
Mikhail Pershin [Thu, 16 Apr 2020 06:22:17 +0000 (09:22 +0300)]
LU-13424 mdt: fix DOM entry check

The mdt_lmm_dom_entry() tries to determine if layout has
DOM entry or not but does that correctly only if DOM entry
is the first one in layout and file is not mirrored.
Otherwise it scans through all entries and wronly reports
that DOM entry exists.

Patch does the following:
- correct initialization of 'has_dom=false' by default
- correct check for DOM+OST case, only if both entries were
  found among initiated entries
- add test case for directory migration with mirrored file

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I43c33528213132f03ebec2debec48b8d53ee229f
Reviewed-on: https://review.whamcloud.com/38257
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
20 months agoLU-10465 lod: adjust component stripe size 61/37661/4
Mikhail Pershin [Fri, 21 Feb 2020 07:07:16 +0000 (10:07 +0300)]
LU-10465 lod: adjust component stripe size

With increased default stripe size to 4MB the problem can
occur when assigning default stripe size to a composite layout
component if stripe size was not specified. There is no strict
requirement to have component boundaries be aligned by default
stripe size, so choosen component end can be not aligned with
system default stripe size, e.g. 3MB end vs 4MB default size.

Patch adds checks for default stripe size assigned to composite
layout components, stripe size should be a multiplier of component
end being the greatest power of two, so check that and reduce it
to the closest valid value when needed.

Fixes: 89693927f0b0 ("LU-8998 lod: accomodate to composite layout")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I823307e097fda30f91ff64cc2bc4130d83c1b211
Reviewed-on: https://review.whamcloud.com/37661
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13349 llite: statahead should skip entry while fid changed 68/37868/5
Yang Sheng [Tue, 10 Mar 2020 17:14:45 +0000 (01:14 +0800)]
LU-13349 llite: statahead should skip entry while fid changed

The fid could change in the Statahead, so the entry should
be skipped in such case.

(lcommon_cl.c:147:cl_file_inode_init()) ASSERTION(
(((inode->i_mode) & 00170000) == 0100000) ) failed:
 kernel: LustreError:(lcommon_cl.c:147:cl_file_inode_init()) LBUG
 kernel: Pid: 106684, comm: ll_sa_94894 3.10.0-957.el7.x86_64 #1
 kernel: Call Trace:
 kernel: [<ffffffffc08587cc>] libcfs_call_trace+0x8c/0xc0 [libcfs]
 kernel: [<ffffffffc085887c>] lbug_with_loc+0x4c/0xa0 [libcfs]
 kernel: [<ffffffffc0e22ba6>] cl_file_inode_init+0x2f6/0x380 [lustre]
 kernel: [<ffffffffc0dfdce5>] ll_update_inode+0x2d5/0x5e0 [lustre]
 kernel: [<ffffffffc0e0afa3>] ll_iget+0x253/0x350 [lustre]
 kernel: [<ffffffffc0dffcf2>] ll_prep_inode+0x262/0x930 [lustre]
 kernel: [<ffffffffc0e1cc2c>] sa_handle_callback+0x37c/0x9d0 [lustre]
 kernel: [<ffffffffc0e1e156>] ll_statahead_thread+0x4d6/0x1c60 [lustre]
 kernel: [<ffffffffa64c1c31>] kthread+0xd1/0xe0
 kernel: [<ffffffffa6b74c1d>] ret_from_fork_nospec_begin+0x7/0x21

Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: Ieee99cc935a111cf05f65b64512b546d2e9b3c74
Reviewed-on: https://review.whamcloud.com/37868
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13445 tests: enhance ha.sh to support different users 01/38201/2
Elena Gryaznova [Fri, 10 Apr 2020 13:38:53 +0000 (16:38 +0300)]
LU-13445 tests: enhance ha.sh to support different users

Patch adds the ability to run mpi workloads from different users.
The list of users is configured by parameter ha_mpi_users, default
is "mpiuser". Useful for Quota Pools testing.

Test-Parameters: trivial
Cray-bug-id: LUS-8603
Signed-off-by: Elena Gryaznova <elena.gryaznova@hpe.com>
Reviewed-by: Sergey Cheremencev <c17829@cray.com>
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Change-Id: I848e5eda4e8221ad0edde62f05d5c367d2156966
Reviewed-on: https://review.whamcloud.com/38201
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13441 osd-zfs: remove OSD thread info cache size assertion 87/38187/2
Sam Atkinson [Thu, 19 Mar 2020 14:14:57 +0000 (10:14 -0400)]
LU-13441 osd-zfs: remove OSD thread info cache size assertion

Remove assertion which kept OSD thread info cache size under 1000.
This assertion is hit when creating a file with more than 511 stripes.

Signed-off-by: Samuel Atkinson <samatk@amazon.com>
Change-Id: If926ec6653cdd85fb654b2960bc0391442bc0674
Reviewed-on: https://review.whamcloud.com/38187
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13353 quota: add man page for lfs quota 83/38183/5
Gian-Carlo DeFazio [Tue, 7 Apr 2020 01:47:40 +0000 (18:47 -0700)]
LU-13353 quota: add man page for lfs quota

Add a man page for lfs-quota and remove quota
command from lfs man page. References to quotaon,
quotaoff, and quotacheck are removed because
these subcommands no longer exist.

Test-Parameters: trivial
Signed-off-by: Gian-Carlo DeFazio <defazio1@llnl.gov>
Change-Id: I9321b953e072e7fbb4a5f97f5f9033dd4a3a81dc
Reviewed-on: https://review.whamcloud.com/38183
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Tested-by: Maloo <maloo@whamcloud.com>
21 months agoLU-9859 libcfs: make signal-blocking functions inline 81/38081/4
NeilBrown [Wed, 8 Apr 2020 15:15:42 +0000 (11:15 -0400)]
LU-9859 libcfs: make signal-blocking functions inline

cfs_block_sigsinv() and cfs_restore_sigs() are now
simple enough to inline them.

Linux-commit: 6b7936ceefa7ed1d7c0576ed9660cc6cb90d61df

Change-Id: I36c62a091a9c066573930cfbae9bf65836203516
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-on: https://review.whamcloud.com/38081
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13375 flr: inherit the correct layout by "mirror extend -N" 79/38079/4
Emoly Liu [Thu, 9 Apr 2020 10:22:28 +0000 (18:22 +0800)]
LU-13375 flr: inherit the correct layout by "mirror extend -N"

For PFL files, if stripe information is not specified to the cmd
"lfs mirror extend -N", the layout of the last initialized comp of
this file should be inherited by the mirror.
For example,
  lcm_mirror_count:  2
  lcm_entry_count:   4
    lcme_id:             65537
    lcme_mirror_id:      1
    lcme_flags:          init
    lcme_extent.e_start: 0
    lcme_extent.e_end:   10485760
      lmm_stripe_count:  1
      lmm_stripe_size:   1048576
      lmm_objects:
      - 0: { l_ost_idx: 2, l_fid: [0x100020000:0x102:0x0] }

    lcme_id:             65538
    lcme_mirror_id:      1
    lcme_flags:          init
    lcme_extent.e_start: 10485760
    lcme_extent.e_end:   20971520
      lmm_stripe_count:  2
      lmm_stripe_size:   2097152
      lmm_objects:
      - 0: { l_ost_idx: 3, l_fid: [0x100030000:0x91:0x0] }
      - 1: { l_ost_idx: 0, l_fid: [0x100000000:0x13d:0x0] }

    lcme_id:             65539
    lcme_mirror_id:      1
    lcme_flags:          0
    lcme_extent.e_start: 20971520
    lcme_extent.e_end:   EOF
      lmm_stripe_count:  -1
      lmm_stripe_size:   4194304

    lcme_id:             131073
    lcme_mirror_id:      2
    lcme_flags:          init
    lcme_extent.e_start: 0
    lcme_extent.e_end:   EOF
      lmm_stripe_count:  2
      lmm_stripe_size:   2097152
      lmm_pool:          archive
      lmm_objects:
      - 0: { l_ost_idx: 1, l_fid: [0x100010000:0x17c:0x0] }
      - 1: { l_ost_idx: 2, l_fid: [0x100020000:0x103:0x0] }

sanity-flr.sh test_0f is modified to verify this patch.

Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Change-Id: If7db3ec7ce9414a04a32e9995ba24f322fb93ab5
Reviewed-on: https://review.whamcloud.com/38079
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-12846 mdd: return error while delete failed 02/36602/28
Yang Sheng [Tue, 29 Oct 2019 06:35:59 +0000 (14:35 +0800)]
LU-12846 mdd: return error while delete failed

Since we use a global buffer, So avoid to replace the
index name while iterate the orphan directory. Also
return error code in mdd_orphan_destroy while dt_delete
failed. Else will cause a dead loop.

Fixes: e1ace3751f ("LU-8514 mdd: transaction failure should be checked")
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: I6fc3e992333ffa61900074309223555264cfe66b
Reviewed-on: https://review.whamcloud.com/36602
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Artem Blagodarenko <c17828@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13430 vfs: add ll_vfs_getxattr/ll_vfs_setxattr compat macro 75/38175/2
Sebastien Buisson [Mon, 6 Apr 2020 09:29:10 +0000 (09:29 +0000)]
LU-13430 vfs: add ll_vfs_getxattr/ll_vfs_setxattr compat macro

Instead of checking everywhere in the code whether kernel defines
__vfs_getxattr/__vfs_setxattr/__vfs_removexattr, define compat macros
to handle this in lustre_compat.h.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iabb54c41e6ccc4b9524f614308a4cd98c5a7ec55
Reviewed-on: https://review.whamcloud.com/38175
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13425 lfs: support numeric hash type by "lfs migrate -H" 82/38182/8
Emoly Liu [Thu, 9 Apr 2020 11:30:12 +0000 (19:30 +0800)]
LU-13425 lfs: support numeric hash type by "lfs migrate -H"

This patch allows "lfs migrate -H" to use numertic hash type in case
of any error message returned by the server in such a form, e.g.
"run 'lfs migrate -m 1 -c 1 -H 3 dir1' to finish migration".

sanity.sh test_230d is modifed a little to verify this patch and
lfs-migrate.1 and lfs migrate usage is updated to reflect this change.

Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Change-Id: I19cda608b2d28e8e392f03db366767b829ed6dc6
Reviewed-on: https://review.whamcloud.com/38182
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
21 months agoRevert "LU-4801 ldlm: discard l_lock from struct ldlm_lock." 38/38238/2
Oleg Drokin [Wed, 15 Apr 2020 21:40:12 +0000 (21:40 +0000)]
Revert "LU-4801 ldlm: discard l_lock from struct ldlm_lock."

This makes reocurence of LU-11568 back in force. I just did not realize it due to some mail filters.

This reverts commit 0584eb73dbb5b4c710a8c7eb1553ed5dad0c18d8.

Change-Id: I9efe670ab9b9b9f2ea81582fe67feaac668e54d5
Reviewed-on: https://review.whamcloud.com/38238
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-4801 ldlm: discard l_lock from struct ldlm_lock. 83/35483/19
NeilBrown [Tue, 27 Aug 2019 16:13:50 +0000 (12:13 -0400)]
LU-4801 ldlm: discard l_lock from struct ldlm_lock.

This spinlock (l_lock) is only used to stablise the l_resource
pointer while taking a spinlock on the resource.

This is not necessary - it is sufficient to take the resource
spinlock, and then check if l_resource has changed or not.  If it
hasn't then it cannot change until the resource spinlock is dropped.

We must ensure this is safe even if the resource is freed before
lock_res_and_lock() managed to get the lock.  To do this we mark the
slab as SLAB_TYPESAFE_BY_RCU and initialise the lock in an
init_once() function, but not on every allocate (and specifically
don't zero the whole struct on each allocation).
This means that if we find a resource after taking the RCU read lock,
then it is always safe to take and then drop the spinlock.
After taking the spinlock, we can check if it is more generally safe
to use.

Discarding l_lock shrinks 'struct ldlm_lock' which helps save memory.

Change-Id: I2646f198ca60bdbd2e94922bf7679fab31f45c41
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-on: https://review.whamcloud.com/35483
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13423 tests: cleanup_netns correctly set result 57/38157/2
Shaun Tancheff [Tue, 7 Apr 2020 23:05:06 +0000 (18:05 -0500)]
LU-13423 tests: cleanup_netns correctly set result

The existence test for 'test1pl' should not result in
cleanup_netns returning failure to the caller.

A slightly more terse if/else can be used to ensure the
caller is notified of failure only in the case of
test1pl not being deleted.

Test-Parameters: trivial
HPE-bug-id: LUS-8713
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I85dee20ec0f0ccd0be17597431fcedda9469d9da
Reviewed-on: https://review.whamcloud.com/38157
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13418 gnilnd: CFS_ALLOC_PTR_ARRAY typos 48/38148/2
Shaun Tancheff [Tue, 7 Apr 2020 02:01:47 +0000 (21:01 -0500)]
LU-13418 gnilnd: CFS_ALLOC_PTR_ARRAY typos

CFS_FREE_PTRE_ARRAT should be CFS_FREE_PTR_ARRAY
CFS_FREE_PTRE_ARRAY should be CFS_FREE_PTR_ARRAY

Fixes: b1f6f3becedc9 ("LU-9679 libcfs: Add CFS_ALLOC_PTR_ARRAY and free")
Test-Parameters: trivial
HPE-bug-id: LUS-8704
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I0e8c487ebdd436c5a402343ffd0a1733b23af4cb
Reviewed-on: https://review.whamcloud.com/38148
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-7653 lod: fix stripe allocation during recovery 37/38137/3
Alexander Boyko [Mon, 6 Apr 2020 07:04:26 +0000 (03:04 -0400)]
LU-7653 lod: fix stripe allocation during recovery

replay-single 110f fails sometimes because it gets
less directory stripes during replay. lod_prep_md_striped_create()
skips MDT from allocation if MDT is not connected(dt_statfs returns
error).

lod_prep_md_striped_create()) try idx 0, mdt cnt 2, allocated 1
osp_statfs())Process entered
osp_statfs())Process leaving (rc=18446744073709551509 :
 -107 : ffffffffffffff95)
lod_prep_md_striped_create())lustre-MDT0001-mdtlov:
require stripes 2 only get 1

The patch allows striping if lod target is active(fid allocation
is working).

Signed-off-by: Alexander Boyko <c17825@cray.com>
Cray-bug-id: LUS-7550
Change-Id: I23ac3c2561d90a47ec04599818e88054395b7787
Reviewed-on: https://review.whamcloud.com/38137
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13404 utils: fix lfs mirror duplicate file check 08/38108/2
Andreas Dilger [Tue, 31 Mar 2020 22:45:40 +0000 (16:45 -0600)]
LU-13404 utils: fix lfs mirror duplicate file check

Fix the check_same_file() check to work if the output file does not
exist.  Since the file is opened with O_CREAT|O_EXCL then definitely
it cannot be the same as the input file.

Add test_0j to verify "lfs mirror read -o" and "lfs mirror write -i".

Test-Parameters: trivial testlist=sanity-flr env=ONLY=0j
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ide929b53a528bd0cc77e1f997d3c561c67729179
Reviewed-on: https://review.whamcloud.com/38108
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13399 lfsck: tune lfsck repair message 00/38100/3
Alexander Zarochentsev [Tue, 3 Mar 2020 20:50:39 +0000 (23:50 +0300)]
LU-13399 lfsck: tune lfsck repair message

namespace LFSCK repair the shard N message printed
even there was nothing to repair which is confusing.

HPE-bug-id: LUS-8548
Signed-off-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Change-Id: I34cc79f59eb76c1f6a86baeed81f8372c133b746
Reviewed-on: https://review.whamcloud.com/38100
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13258 ptlrpc: bind pinger workqueue to CPT set 91/38091/3
James Simmons [Fri, 27 Mar 2020 16:26:30 +0000 (12:26 -0400)]
LU-13258 ptlrpc: bind pinger workqueue to CPT set

Lustre uses a pinger to determine if nodes are available which is
done using a workqueue. The workqueue can currently run on any
core. This has performance impact on applications but this can be
avoided by binding the workqueues to the cores Lustre as set aside
for its self. Additionally create a proper kernel config option
for enabling the pinger.

Change-Id: I6fefb0f1fd266ef4ac7016f092fe9e7908f010e9
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/38091
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13394 llite: avoid sending OST RPC for project setting 89/38089/2
Wang Shilong [Fri, 27 Mar 2020 02:05:17 +0000 (10:05 +0800)]
LU-13394 llite: avoid sending OST RPC for project setting

LL_IOC_FSSETXATTR ioctl could be used to handle inode flags
setting, currently it is mainly used to hanlde project ID changing.

The only flags for project is inherit flag, there is no need
to send this to OST, so we could avoid this kind of RPC to OSS.

Change-Id: Ief97959216be807d5efe936eba368d5262a521b0
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/38089
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-12477 kernel: remove dev_read_only handling 70/38070/3
James Simmons [Wed, 25 Mar 2020 15:13:18 +0000 (11:13 -0400)]
LU-12477 kernel: remove dev_read_only handling

To test disk failures Lustre developed a method for ldiskfs to
make the backend block device appears to have failed. Modern
kernels offer the same thing with dm-flakey. Lustre has moved
to dm-flakey for some time so the old dev_read_only can now be
removed.

Change-Id: I3d5887ab8c0daf1c94c9069bcdd58786b2819ac0
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/38070
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
21 months agoLU-13005 lnet: Support checking for MD leaks. 59/38059/4
Mr NeilBrown [Wed, 25 Mar 2020 05:26:28 +0000 (16:26 +1100)]
LU-13005 lnet: Support checking for MD leaks.

Since we dropped the refcounting on LNetEQ we no longer get
confirmation that all MDs for a given handler a gone by the
time they should be.

So add lnet_assert_handler_unused() which searches the per-cpt
containers and ensures there are no MDs for a given handler, and call
that are the same place that we used to call LNetEQFree().

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ic04e5b4f67a79055c49994bd1d92e275fa71dd4b
Reviewed-on: https://review.whamcloud.com/38059
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13156 tests: wait for nodemap update in sanity-selinux 34/38034/4
Sebastien Buisson [Mon, 23 Mar 2020 15:23:57 +0000 (16:23 +0100)]
LU-13156 tests: wait for nodemap update in sanity-selinux

In sanity-selinux test_21a and test_21b, nodemaps are used to test
SELinux status checking (sepol).
We must wait for nodemap update on all MDS nodes before carrying out
tests.

Test-Parameters: clientselinux mdscount=2 mdtcount=4 testlist=recovery-small,sanity-selinux env=ONLY="21 23",ONLY_REPEAT=100
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I363e2bec757efc199f7039f8af4bcb77e2a2a184
Reviewed-on: https://review.whamcloud.com/38034
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13383 ofd: lazy atime update 24/38024/21
Alex Zhuravlev [Tue, 31 Mar 2020 08:06:03 +0000 (11:06 +0300)]
LU-13383 ofd: lazy atime update

OST_BRW_WRITE updates atime both in memory and on-disk
OST_BRW_READ updates atime in memory and once difference
exceeds delay (obdfilter.*.atime_delay seconds) - it's
updated on-disk.

Test-Parameters: testlist=sanity env=ONLY=39r,ONLY_REPEAT=100
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ibe49882ec6f1984f9cf6a32f6ee9fef579ed2a03
Reviewed-on: https://review.whamcloud.com/38024
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
21 months agoLU-13347 kernel: RHEL 7.8 server support 48/37948/5
Jian Yu [Fri, 3 Apr 2020 17:55:07 +0000 (10:55 -0700)]
LU-13347 kernel: RHEL 7.8 server support

This patch makes changes to support new RHEL 7.8 release
for Lustre server (kernel 3.10.0-1127.el7).

Test-Parameters: trivial clientdistro=el7.8 serverdistro=el7.8

Change-Id: I4817fd2f9512111aa7d26109454104945fd2778f
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37948
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13347 kernel: new kernel [RHEL 7.8 3.10.0-1127.el7] 12/37912/5
Jian Yu [Thu, 2 Apr 2020 00:32:19 +0000 (17:32 -0700)]
LU-13347 kernel: new kernel [RHEL 7.8 3.10.0-1127.el7]

This patch makes changes to support new RHEL 7.8 release
for Lustre client.

Test-Parameters: trivial clientdistro=el7.8

Change-Id: I82f89495d5ab1d46a539a016a899307d7c8f37b7
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37912
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13004 lnet: don't embed whole lnet_md in lnet_event 40/37840/7
Mr NeilBrown [Mon, 6 Apr 2020 16:59:35 +0000 (12:59 -0400)]
LU-13004 lnet: don't embed whole lnet_md in lnet_event

Of the several fields that are copied into the lnet_md which is
embedded in an lnet_event, only three are ever used:
  start, user_ptr, md_options

Rather than allocating space for the whole structure, copying only
some in, and then using even fewer; just store the fields that are
needed.

Note that a comment suggests that the "threshold" value is
interesting, but this value is never used.  The comment has been
removed.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I7a69b52a65dda815b533c605f581e22fc4445be0
Reviewed-on: https://review.whamcloud.com/37840
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13309 osd-ldiskfs: speedup osd_bufs_get/put 86/37786/4
Andrew Perepechko [Fri, 28 Feb 2020 15:53:16 +0000 (18:53 +0300)]
LU-13309 osd-ldiskfs: speedup osd_bufs_get/put

Let's remove useless page processing
in osd_get_put/osd_put_page that affects regular I/O
in non-cached mode.

Change-Id: I1972cfdec940f104c1d66e1b1ffb4faa6007929b
Signed-off-by: Andrew Perepechko <c17827@cray.com>
Cray-bug-id: LUS-8004
Reviewed-on: https://review.whamcloud.com/37786
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13005 lnet: remove 'eq' from names, use 'handler' 78/37378/6
Mr NeilBrown [Fri, 31 Jan 2020 00:16:20 +0000 (11:16 +1100)]
LU-13005 lnet: remove 'eq' from names, use 'handler'

Now that we don't have an event-queue subsystem, using
'eq' in various names is confusing.
We have events and event handlers, so change
  lnet_eq_handler_t to lnet_handler_t
and change variable names mentioned 'eq' to just
mention 'handler'.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: If6f34ed41c565cb37ac798b5ba0411b6a471d6d0
Reviewed-on: https://review.whamcloud.com/37378
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13169 tests: quiet debug messages during tests 38/37338/11
Andreas Dilger [Tue, 28 Jan 2020 00:29:09 +0000 (17:29 -0700)]
LU-13169 tests: quiet debug messages during tests

Quiet the output of check_network() and check_node_health() that are
printed for *every* subtest that is run, since this is distracting
when looking at the test output, and can often be more verbose than
the actual test output.

Don't get the client and server versions repeatedly, since they will
not change for the duration of a test run and can be cached instead.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib42b01c9ca36c6c72d2c7ffffbd3a5f2643ebbe5
Reviewed-on: https://review.whamcloud.com/37338
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13005 lnet: remove lib-eq. 47/36847/8
Mr NeilBrown [Wed, 20 Nov 2019 02:56:44 +0000 (13:56 +1100)]
LU-13005 lnet: remove lib-eq.

There is nothing of value in left in lib-eq.  An 'lnet_eq' just holds
a function pointer.
So change all 'struct lnet_eq' pointers to function pointers, and
bypass the "event queues".

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I16786e44ab712a76860fe8d83543a292555cf557
Reviewed-on: https://review.whamcloud.com/36847
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13005 lnet: drop refcounting from event queues. 46/36846/10
Mr NeilBrown [Wed, 20 Nov 2019 02:31:09 +0000 (13:31 +1100)]
LU-13005 lnet: drop refcounting from event queues.

The refcount is no longer incremented or decremented
as there is no interesting state and no long term
references.  Nothing checks if LNetEQFree returns -EBUSY
any more - though a few calls LASSERT() that the return
value is 0.

So discard the refcounting, change LNetEQFree to return
'void', and remove all the LASSERTs.

Change-Id: I976834e7c6193765948e3b1a4f02069e33cdbe1e
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/36846
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-12780 osp: don't use ptlrpc_thread for osp_sync_thread() 65/36265/8
Mr NeilBrown [Wed, 23 Oct 2019 00:30:50 +0000 (11:30 +1100)]
LU-12780 osp: don't use ptlrpc_thread for osp_sync_thread()

Instead of ptlrpc_thread, just use native kthread functionality.

- Move allocations to before the thread is created, so error
  reporting is easier.
- add a completion so that we can be sure that the thread is stared,
  and hence know that cleanup will eventually happen.
- use kthread_stop() to tell the thread to stop, and
  kthread_should_stop() to see if it has bene told.
- clear ->opd_sync_task before calling kthread_stop(), and
  use a test for NULL to see if the thread is stopping

- As some error conditions can cause the thread to exit before being
  asked, and as kthread_stop() doesn't handle this possibility, add
  an extra handshake.
  Both thread-exit and osp_sync_fini() atomically exchange NULL for
  the thread pointer.
  If thread-exit is first, the exit proceeds and osp_sync_fini() never
  waits.  For osp_sync_fini() is first, it calls kthread_exit() to
  wait, and thread-exit doesn't happen until it is sure that
  kthread_stop() is waiting.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I952cbdae90252476853854d89b8f1a78d95ddbde
Reviewed-on: https://review.whamcloud.com/36265
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-11025 tests: only set crush for newer builds 07/38107/4
Andreas Dilger [Tue, 31 Mar 2020 23:25:15 +0000 (17:25 -0600)]
LU-11025 tests: only set crush for newer builds

Don't set default DNE hash type to crush if MDS doesn't support it.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1c91f1149d9472bbe1f30ce3f01565835ed7ab01
Reviewed-on: https://review.whamcloud.com/38107
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-11814 obd: Crashed while mount in parallel 74/37974/10
Yang Sheng [Tue, 10 Mar 2020 13:53:26 +0000 (21:53 +0800)]
LU-11814 obd: Crashed while mount in parallel

Ensure obd_type init finished before obd_setup was started.
Also included a test case to reproduce the failure.

 (osd_handler.c:7132:osd_device_init0()) ASSERTION( info ) failed:
 (osd_handler.c:7132:osd_device_init0()) LBUG
 Pid: 2457, comm: mount.lustre 3.10.0-862.9.1.el7_lustre.ddn1.x86_64
Call Trace:
 [<ffffffffc042f7cc>] libcfs_call_trace+0x8c/0xc0 [libcfs]
 [<ffffffffc042f87c>] lbug_with_loc+0x4c/0xa0 [libcfs]
 [<ffffffffc10cc6d5>] osd_device_alloc+0x615/0x770 [osd_ldiskfs]
 [<ffffffffc099ae2a>] obd_setup+0x11a/0x2b0 [obdclass]
 [<ffffffffc099cc58>] class_setup+0x2a8/0x840 [obdclass]
 [<ffffffffc09a08ed>] class_process_config+0x196d/0x2420 [obdclass]
 [<ffffffffc09a45f8>] do_lcfg+0x258/0x500 [obdclass]
 [<ffffffffc09a8e68>] lustre_start_simple+0x88/0x210 [obdclass]
 [<ffffffffc09d59b4>] server_fill_super+0xf34/0x185a [obdclass]
 [<ffffffffc09abfe8>] lustre_fill_super+0x328/0x950 [obdclass]
 [<ffffffff9781f3bf>] mount_nodev+0x4f/0xb0
 [<ffffffffc09a4008>] lustre_mount+0x38/0x60 [obdclass]
 [<ffffffff9781ff3e>] mount_fs+0x3e/0x1b0
 [<ffffffff9783d4c7>] vfs_kern_mount+0x67/0x110
 [<ffffffff9783faef>] do_mount+0x1ef/0xce0
 [<ffffffff97840923>] SyS_mount+0x83/0xd0
 [<ffffffff97d20795>] system_call_fastpath+0x1c/0x21

Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: If3129df5fd11226636fb84a9275f481cefb749f7
Reviewed-on: https://review.whamcloud.com/37974
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
21 months agoLU-13356 client: don't use OBD_CONNECT_MNE_SWAB 80/37880/11
Alexander Boyko [Wed, 11 Mar 2020 10:40:52 +0000 (06:40 -0400)]
LU-13356 client: don't use OBD_CONNECT_MNE_SWAB

OBD_CONNECT_MNE_SWAB is equal to OBD_CONNECT_MDS_MDS, and
it was used at MGC client in past for mne swabbing during interop.
Right now it is interpreted at MGS like OBD_CONNECT_MDS_MDS and skip
these clients from eviction and lock canceling after timeout.

Fixes: 1bdc4fd0594e ("LU-6307 obdclass: distinguish MGC/MDT connection properly")
Test-Parameters: testlist=runtests clientversion=2.12 envdefinitions=MDS_MOUNT_OPTS="-orw",OST_MOUNT_OPTS="-orw"
Test-Parameters: testlist=runtests serverversion=2.12 envdefinitions=MDS_MOUNT_OPTS="-orw",OST_MOUNT_OPTS="-orw"
Test-Parameters: testlist=runtests clientversion=2.10 clientdistro=el7.6 envdefinitions=MDS_MOUNT_OPTS="-orw",OST_MOUNT_OPTS="-orw"
Test-Parameters: testlist=runtests serverversion=2.10 serverdistro=el7.6 envdefinitions=MDS_MOUNT_OPTS="-orw",OST_MOUNT_OPTS="-orw"
Signed-off-by: Alexander Boyko <c17825@cray.com>
Cray-bug-id: LUS-8484
Change-Id: I4f8ddeb1808cfaee7507e0efcdefa24040cfcbb6
Reviewed-on: https://review.whamcloud.com/37880
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Artem Blagodarenko <c17828@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-6142 lustre: no need to check debugfs return values 48/37748/4
Mr NeilBrown [Thu, 27 Feb 2020 05:17:41 +0000 (16:17 +1100)]
LU-6142 lustre: no need to check debugfs return values

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Clean up the lustre core code by not caring about the value of debugfs
calls.  This ends up removing a number of lines of code that are not
needed.

Test-Parameters: trivial
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I78bddd60a8ae26418e1b4f99938b21cd652aea08
Reviewed-on: https://review.whamcloud.com/37748
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-6142 lustre: remove ldebugfs_add_simple() wrapper. 47/37747/6
Mr NeilBrown [Thu, 27 Feb 2020 05:13:59 +0000 (16:13 +1100)]
LU-6142 lustre: remove ldebugfs_add_simple() wrapper.

This is never used, so it not needed.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Id711102ba9b71fe326e7fe792cb2ed5e511328fe
Reviewed-on: https://review.whamcloud.com/37747
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
21 months agoLU-6142 lustre: remove ldebugfs_register_stats() wrapper 46/37746/6
Mr NeilBrown [Thu, 27 Feb 2020 05:11:58 +0000 (16:11 +1100)]
LU-6142 lustre: remove ldebugfs_register_stats() wrapper

It was just calling debugfs_create_file() so unwind things and just
call the real function instead.  This ends up saving a number of lines
as there was never any error handling happening anyway, so that all
can be removed as well.

Test-Parameters: trivial
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I7e30139cc8e810ab4bc49ae9c298e6199c3f2942
Reviewed-on: https://review.whamcloud.com/37746
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
21 months agoLU-6142 lustre: remove ldebugfs_seq_create wrapper function 45/37745/5
Mr NeilBrown [Thu, 27 Feb 2020 05:00:32 +0000 (16:00 +1100)]
LU-6142 lustre: remove ldebugfs_seq_create wrapper function

It was just calling debugfs_create_file() so unwind things and just
call the real function instead.  This ends up saving a number of lines
as there was never any error handling happening anyway, so that all
can be removed as well.

Test-Parameters: trivial
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I7103ef2a44348f28b958730413e93e0878eba4d2
Reviewed-on: https://review.whamcloud.com/37745
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
21 months agoLU-6142 lustre: make ldebugfs_add_vars a void function 44/37744/6
Mr NeilBrown [Thu, 27 Feb 2020 04:43:57 +0000 (15:43 +1100)]
LU-6142 lustre: make ldebugfs_add_vars a void function

The call to ldebugfs_add_vars() can not really fail, so have it just
return nothing, which allows us to clean up a lot of unused error
handling code.

Linux-Commit d5bf5cf9e150 ("staging: lustre: make ldebugfs_add_vars a
void function")

Test-Parameters: trivial
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I338c573fe5cb7dbd3595247f5c3647f5c1bf949b
Reviewed-on: https://review.whamcloud.com/37744
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-10391 socklnd: use interface index to track local addr 02/37702/11
Mr NeilBrown [Fri, 7 Feb 2020 02:05:57 +0000 (13:05 +1100)]
LU-10391 socklnd: use interface index to track local addr

socklnd currently uses local IP addresses to track the local end of a
route or connection.  This will not work so well for IPv6 where
addresses are generally more dynamic - an interface can have several
addresses and they can come and go.

Even with IPv4, an interface can have multple addresses, though this
is partially hidden as there we normally use aliases which make it
looks like different interfaces: eth0:1 eth0:2 etc.  These are really
all the same interface, just with different addresses.

It is really the local interface, rather than the local address,
which is important.  Choosing the right interface ensures the traffic
goes over the desired network hardware.  Using an address, as the code
currently does, is just a convenient indirection.

With IPv6, using the interface directly will be easier, and it is
quite possible with IPv4.

So: this patch changes ksock_route to store an interface index for the
source end of the route, and adds the index nubmer to ksock_interface.

lnet_sock_listen() loses the local IP address which is never used, and
lnet_sock_connect() now is passed a source interface rather than a
source IP address.
lock_sock_create() also gets a local source interface.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ib3e0f92d10ad6ba4d66782bae22638e9935a1e4e
Reviewed-on: https://review.whamcloud.com/37702
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-10391 lnet: simplify use of lnet_count_acceptor_nets() 95/37695/8
Mr NeilBrown [Fri, 7 Feb 2020 02:05:57 +0000 (13:05 +1100)]
LU-10391 lnet: simplify use of lnet_count_acceptor_nets()

Instead of calling this in various places before either
lnet_acceptor_start() or lnet_acceptor_stop(), only call
it in those functions.
It is already called in lnet_acceptor_start().

At shutdown, lnet_acceptor_stop() must succeed unconditionally, so
include a test on the_lnet.ln_refcount.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I11ef6c1a226e7b752b540f37651c766e83c5cb52
Reviewed-on: https://review.whamcloud.com/37695
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-9679 osc: convert oe_refc to kref 01/37601/9
NeilBrown [Wed, 12 Dec 2018 06:49:53 +0000 (17:49 +1100)]
LU-9679 osc: convert oe_refc to kref

oe_refc is used like a kref, so make it one.

As cl_object_put() needs an 'env', we cannot quite use
kref_put() as intended.  Maybe that can be fixed one day.

This requires kref_read() to be provided for older kernels.

The original Linux-commit also converted oe_users to a refcount_t
but that was later reverted.

Linux-Commit: 35ea2a7c694b ("lustre: osc: convert oe_refc and oe_users
to kref and refcount_")

Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I42fd17c4261b85b273387936b97fce463273e2b8
Reviewed-on: https://review.whamcloud.com/37601
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-9679 lustre: add OBD_ALLOC_PTR_ARRAY() and others 76/36976/12
Mr NeilBrown [Thu, 14 Nov 2019 03:20:01 +0000 (14:20 +1100)]
LU-9679 lustre: add OBD_ALLOC_PTR_ARRAY() and others

Similar to CFS_ALLOC_PTR_ARRAY(), add
  OBD_ALLOC_PTR_ARRAY
  OBD_ALLOC_PTR_ARRAY_WAIT
  OBD_FREE_PTR_ARRAY
  OBD_ALLOC_PTR_ARRAY_LARGE
  OBD_FREE_PTR_ARRAY_LARGE

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I253d4497ed7cbbe1afc5c66c2aa753bb272a4ad5
Reviewed-on: https://review.whamcloud.com/36976
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
21 months agoLU-9868 llite: Get rid of ll_dcompare 75/24175/5
Oleg Drokin [Fri, 3 Apr 2020 03:24:04 +0000 (23:24 -0400)]
LU-9868 llite: Get rid of ll_dcompare

The problem with real_lookup, and real_lookup itself are long gone,
so let's kick out invalid dentries in revalidate now.

Change-Id: Ieb274645245a19ac4917e0ec4643a0c44aa32cd3
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: https://review.whamcloud.com/24175
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13127 libcfs: make noise to console if CRC32 is missing 14/37214/9
Alex Zhuravlev [Mon, 13 Jan 2020 09:37:44 +0000 (12:37 +0300)]
LU-13127 libcfs: make noise to console if CRC32 is missing

if CRC32 support is disabled in the kernel by mistake, then
early replies don't work and the actual cause isn't obvious.

the patch also adds a check at configure to ensure that
target kernel support CRC32 crypto function.

Change-Id: I17999ae89eaf6c4fb7c7db12200e2092cc6afea8
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37214
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
21 months agoLU-6202 obd: replace OBD_IOC_NO_TRANSNO with sysfs file 93/35993/22
James Simmons [Wed, 25 Mar 2020 11:57:40 +0000 (07:57 -0400)]
LU-6202 obd: replace OBD_IOC_NO_TRANSNO with sysfs file

We can replace the ioctl OBD_IOC_NO_TRANSNO, which is server side
only, with a sysfs file. The original ioctl set an internal obd
device flags to simulate transactions not reaching the disk. The
new write only sysfs file behaves the exact same way.

Change-Id: Ie78feec61fab46a1982bd5caca3e89613356d2e8
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/35993
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13274 uapi: make lnet UAPI headers C99 compliant 71/37971/11
James Simmons [Tue, 24 Mar 2020 18:49:48 +0000 (14:49 -0400)]
LU-13274 uapi: make lnet UAPI headers C99 compliant

Attempting to compile strict C99 user land applications or
libraries with the Lustre UAPI headers will fail. These same
errors can be seen by enabling CONFIG_UAPI_HEADER_TEST as well.
Update the LNet UAPI headers to be compilable with -std=c99.
Add LNet test covering UAPI header handling.

Test-Parameters: trivial testlist=sanity-lnet

Change-Id: Ic1c30ed2d4d9d1d7f11b657d3817a05161367e13
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37971
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13386 llite: allow current readahead to exceed reservation 47/38047/4
Wang Shilong [Wed, 25 Mar 2020 01:14:07 +0000 (09:14 +0800)]
LU-13386 llite: allow current readahead to exceed reservation

ll_ra_count_get() is designed to allow over reservation for performance
reasons, this could happen that multiple threads consuming a small
readahead window limit, it will fallback to small 4K read which hurts
performances.

Fixes: 8fbef5e("LU-12043 llite: make sure readahead cover current read")
Change-Id: Ied4ee0ffcd55c568c70f7d3074e810cd0034ef04
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/38047
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13385 lnet: Calculate IB service-id 45/38045/6
Amir Shehata [Tue, 24 Mar 2020 22:18:18 +0000 (15:18 -0700)]
LU-13385 lnet: Calculate IB service-id

The service-id is determined by the:
1. port space (currently hard coded to TCP)
2. service port number (defaults to 987)

options ko2iblnd service=<num>

Can be used to change the service port number. However, when
configuring QoS, we need to know the service-id, which can then
be mapped to the service level in the opensm's qos-policy.conf file.

This patch adds a new lnetctl command which returns the service-id.

lnetctl service-id

Test-Parameters: trivial
Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: Ifab46473088239a391314040bac91d0f791ea3e4
Reviewed-on: https://review.whamcloud.com/38045
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13377 llite: fix dead loop for short write 18/38018/6
Wang Shilong [Sat, 21 Mar 2020 01:58:09 +0000 (09:58 +0800)]
LU-13377 llite: fix dead loop for short write

|->vvp_io_write_start()
 |->__generic_file_write_iter()
    |->iov_iter_advance() if write succeed()
  |->vvp_io_write_commit()
     |->update ci_nob

The problem is we will move forward iov iter inside
__generic_file_write_iter(), but @ci_nob will be updated
after vvp_io_write_commit().

If out of quota or some other problems happen, this could
cause a mismatch with @ci_nob and @vui_iter.

And @vui_iter->count will be reset using @ci_nob in
iov_iter_reexpand(), this will make @vui_iter->count
more than what it really left, and we could dead loop
in vvp_mmap_locks() if IO need be retried or restarted:

vvp_io_write_lock+0x45/0x80 [lustre]
cl_io_lock+0x5f/0x3d0 [obdclass]
cl_io_loop+0x92/0x190 [obdclass]
ll_file_io_generic+0x7b3/0xc90 [lustre]
ll_file_aio_write+0x12d/0x1f0 [lustre]
ll_file_write+0xce/0x1e0 [lustre]
vfs_write+0xc0/0x1f0
SyS_write+0x7f/0xf0
system_call_fastpath+0x22/0x27

Change-Id: I5fb4c18cf02fb17bf50122b63decacef678caa01
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/38018
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
21 months agoLU-13275 tests: enhance racer with failover 52/37652/5
Elena Gryaznova [Thu, 20 Feb 2020 18:50:44 +0000 (21:50 +0300)]
LU-13275 tests: enhance racer with failover

Patch adds the possibilty to run facet_failovier <random_facet>
if RACER_FAILOVER is set to true.
The type of facets are set over FAIL_TARGETS variable,
default value is "MDS OST".

Test-Parameters: trivial \
envdefinitions=RACER_FAILOVER=true testlist=racer
Cray-bug-id: LUS-8280
Signed-off-by: Elena Gryaznova <c17455@cray.com>
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@hpe.com>
Reviewed-by: Andriy Skulysh <andriy.skulysh@hpe.com>
Change-Id: Iacb6ac855bf77d7c6930fdbb7ec192ecc46264b3
Reviewed-on: https://review.whamcloud.com/37652
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13272 tests: customise dom-performance 50/37650/7
Elena Gryaznova [Thu, 20 Feb 2020 18:01:40 +0000 (21:01 +0300)]
LU-13272 tests: customise dom-performance

dom-performance compares the performance benefits
between the normal file and DoM file.
However it is also interesting to demostrate that if
the file grows beyond the DoM size the performance
for it is not worse compared to the normal file.

Patch allows to set file size beyond the DoM size.

Test-Parameters: trivial mdssizegb=20 \
testlist=dom-performance envdefinitions=ONLY=IOR
Cray-bug-id: LUS-7359
Signed-off-by: Elena Gryaznova <elena.gryaznova@hpe.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Change-Id: I2412b4f1e1d0a591c47a9ceadc37f730c4deedbe
Reviewed-on: https://review.whamcloud.com/37650
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-10395 tests: add test_280 sanity 35/37635/6
Alexander Boyko [Thu, 20 Feb 2020 10:12:03 +0000 (05:12 -0500)]
LU-10395 tests: add test_280 sanity

The test reproduce a race between client llog processing
and MGS umount.

osd_fid2oi()) ASSERTION( osd->od_oi_table != NULL &&
osd->od_oi_count >= 1 ) failed: [0xa:0xb:0x0]

 #3 lbug_with_loc at ffffffffc0c098cb [libcfs]
 #4 __osd_oi_lookup at ffffffffc13e5610 [osd_ldiskfs]
 #5 osd_oi_lookup at ffffffffc13e76fd [osd_ldiskfs]
 #6 osd_fid_lookup at ffffffffc13e2cc5 [osd_ldiskfs]
 #7 osd_object_init at ffffffffc13e44e1 [osd_ldiskfs]
 #8 lu_object_start at ffffffffc0e262ab [obdclass]
 #9 lu_object_find_at at ffffffffc0e2a121 [obdclass]
 #10 dt_locate_at at ffffffffc0e2b6dd [obdclass]
 #11 llog_osd_open at ffffffffc0deae9e [obdclass]
 #12 llog_open at ffffffffc0dd8f3a [obdclass]
 #13 llog_origin_handle_next_block at  ffffffffc1200a06[ptlrpc]
 #14 tgt_llog_next_block at ffffffffc124b6c3 [ptlrpc]

Cray-bug-id: LUS-8505
Test-Parameters: standalonemgs=false trivial testlist=sanity envdefinitions=ONLY=280,ONLY_REPEAT=5
Signed-off-by: Alexander Boyko <c17825@cray.com>
Change-Id: I449b18779bfe391784ad532451213d5d5456c1b1
Reviewed-on: https://review.whamcloud.com/37635
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-10395 osd: stop OI at device shutdown 15/37615/5
Alex Zhuravlev [Tue, 18 Feb 2020 15:04:44 +0000 (18:04 +0300)]
LU-10395 osd: stop OI at device shutdown

and not at obd_cleanup(). otherwise a race is possible:
 umount <MDT> stopping OI vs MGS accessing same OSD which
results in the assertion:
ASSERTION( osd->od_oi_table != NULL && osd->od_oi_count >= 1 )

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I24fccea718f2e2663166cfb0ff26571039357535
Reviewed-on: https://review.whamcloud.com/37615
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-930 doc: update MAINTAINERS and mailmap 49/37549/7
Sergey Cheremencev [Wed, 12 Feb 2020 12:22:40 +0000 (15:22 +0300)]
LU-930 doc: update MAINTAINERS and mailmap

Change cray emails with new hpe.
Add new reviewers from HPE.

Change-Id: I7b5b3270fa16beec84c50ffdf4dc0fb7f85db761
Test-Parameters: trivial
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-on: https://review.whamcloud.com/37549
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13224 utils: expose llapi_param* functions 45/37545/15
Gian-Carlo DeFazio [Tue, 11 Feb 2020 21:08:18 +0000 (13:08 -0800)]
LU-13224 utils: expose llapi_param* functions

Added an interface to find files in sysfs,procfs,etc.,
and read them into a file or buffer.
The interface is meant to return the same results as
the "lctl list_param" and "lctl get_param" commands,
but doesn't require starting an lctl process.

The interface is being used by lctl for parts of
its "list_param" and "get_param" commands.

The output of lctl get_param is altered slightly.
Previously, for some multi-line files lctl would
print the param name and first line of the file on
the same line such as:

param=line 1
line 2
line 3

Now multi-line files consistently put a newline
after the param name and before the content such as:

param=
line 1
line 2
line 3

Added debug output to failing test sanity 300d.

Signed-off-by: Gian-Carlo DeFazio <defazio1@llnl.gov>
Change-Id: I2726b27b0042d58c97284f8348970deb6efc43d1
Reviewed-on: https://review.whamcloud.com/37545
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13134 clio: cl_page index compaction 17/37417/5
Patrick Farrell [Tue, 4 Feb 2020 01:05:27 +0000 (20:05 -0500)]
LU-13134 clio: cl_page index compaction

The cpl_index field is not necessary for the vvp layer,
since that's the same as the vm page index, and it has
already been duplicated for the lov layer.

So, moving the osc usage of this to the top, we can save
24 bytes per page (in the slices) by removing this from
the cl_page_slice, at the cost of 8 bytes in the cl_page.
So a net savings of 16 bytes.

After this patch, cl_page could be reduced from 408 to
392 bytes.

Signed-off-by: Patrick Farrell <farr0186@gmail.com>
Change-Id: Ib4fd75f112afb816443799314cd2ef75ff4f4c84
Reviewed-on: https://review.whamcloud.com/37417
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13134 obdclass: use slab allocation for cl_page 25/37225/17
Wang Shilong [Thu, 16 Jan 2020 07:05:08 +0000 (15:05 +0800)]
LU-13134 obdclass: use slab allocation for cl_page

Currently we use kmalloc() for cl_page allocation, this is because
cl_page size could be different with different objects.

For most cases (except obdecho object) we have 408 bytes for cl_page.
kmalloc() uses 512 bytes slab for it. So for 4KB PAGE_SIZE, we could
allocate 8 cl_page in a single page.

If we use private slab cache, it can fit 10 cl_page for 4KB PAGE_SIZE,
and even more struct cl_page can fit if we reduce the struct size.
For 4GB of pages the cl_page memory usage will shrink from 512M to 408M.

With clients already having 100GB of memory, it will save us 2.5GB
memory usage for cl_page, and some systems have as much as 24TB today!

This patch uses a static array with N (currently 16) entries storing
the { size, slab pointer }, with only 2-3 entries in current usage.
If the static array is not large enough, then fall back to kmalloc().

Benchmark numbers:

    4KB Random Read
    fio -iodepth=128 -direct=1 -size=2g -runtime=60 -numjobs=256
        -group_reporting  -directory=/ai400/out -create_serialize=0
        -filename_format='f.$jobnum.$filenum'

                        master+     master+
                        LU-4198     LU-4198+
                                    LU-13134   delta
      QD=1, numjobs=1     4518       4538      +0.44%
    QD=128, numjobs=256   2177K      2207k     +1.38%

Change-Id: I565b09616b22706f93d4c0fdc0df396d06cd51cc
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/37225
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
21 months agoLU-13258 llite: bind readahead workqueue to CPT set 17/37717/9
James Simmons [Wed, 25 Mar 2020 02:47:00 +0000 (22:47 -0400)]
LU-13258 llite: bind readahead workqueue to CPT set

A workqueue is used by Lustre to optimize readahead. This work
queue can run on any core and can easily be over surscribed. This
will have a negative impact on HPC applications running on a
Lustre client. Limit the number of threads a workqueue can run
to the size of the CPU allocated for Lustre and only allow those
threads to run on the cores belonging to the CPT set.

Change-Id: Ifcc662d52843f5028c34d55695c1d6297e5c00b0
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37717
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Stephen Champion <stephen.champion@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-12846 tests: verify orphan upgrade compatibilty 36/37636/7
Artem Blagodarenko [Wed, 19 Feb 2020 16:38:31 +0000 (11:38 -0500)]
LU-12846 tests: verify orphan upgrade compatibilty

There was a discussion in LU-13070 that name compatibility
is useless, because orphan's name is not taken into account
in orphans deletion loop.

This test shows that orphan with a name format before 2.11
can not be deleted in mdd_orphan_destroy() that can lead
to an endless loop:

    mdd_orphan_destroy() t32fs-MDD0000: could not delete
        orphan [0x200000bd0:0x1:0x0]: rc = -2

Print a banner in each test_32 subtest to separate images.

Test-Parameters: trivial testlist=conf-sanity envdefinitions=ONLY=32,ONLY_REPEAT=4
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
Change-Id: I351ff3e5f3d10dabfd76cb1c9f07d3fc597004a6
Reviewed-on: https://review.whamcloud.com/37636
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
21 months agoLU-12780 quota: don't use ptlrpc_thread for qmt_reba_thread 56/36556/6
Mr NeilBrown [Wed, 23 Oct 2019 00:30:52 +0000 (11:30 +1100)]
LU-12780 quota: don't use ptlrpc_thread for qmt_reba_thread

Instead of ptlrpc_thread, use native kthread functionality.

- for startup, perform allocations before creating the thread so that
  once created it cannot fail.
  We still use a completion to ensure the thread function runs before
  kthread_stop is called, so that cleanup will happen.

- As lu_env_add() can fail, and needs to know which task owns
  the env, we add a new function lu_env_add_task()

- for shutdown, use kthread_stop() and kthread_should_stop()

- to alert thread of a new event, use wake_up_process()
  Do this under qmt_reba_lock so the thread cannot disappear while
  being woken.
  The thread sets TASK_IDLE, then if any tests show there is work
  to do it sets TASK_RUNNING, so the following schedule() won't
  block and the loop will check again.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: If3f0444d5aa38ea84990d95f85ad18202f99d5df
Reviewed-on: https://review.whamcloud.com/36556
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13131 osc: Always send all HP RPCs requests 57/38057/2
Oleg Drokin [Fri, 7 Feb 2020 01:21:43 +0000 (20:21 -0500)]
LU-13131 osc: Always send all HP RPCs requests

that are resulting from lock cancel activity.

Change-Id: I4007167f0f39b0699e977c14bd160f475d8288ad
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38057
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
21 months agoLU-6174 lod: remove incorrect ll_do_div64 01/38101/2
James Simmons [Mon, 30 Mar 2020 17:06:19 +0000 (13:06 -0400)]
LU-6174 lod: remove incorrect ll_do_div64

ll_do_div64() is just a wrapper around do_div() which is handled
incorrectly. do_div() expects a 32 bit value but stripe_count is
cast to 64 bits which is incorrect. Instead lets just avoid
casting and use do_div() directly.

Change-Id: I08601fdf8e9d5fdf26981f073dd602775c12281b
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/38101
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
21 months agoNew tag 2.13.53 2.13.53 v2_13_53
Oleg Drokin [Mon, 6 Apr 2020 20:55:59 +0000 (16:55 -0400)]
New tag 2.13.53

Change-Id: I0ac2858038f2710a19189d4b621064355ccbbb7d
Signed-off-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13379 tests: don't use localrecov for older servers 22/38022/6
Andreas Dilger [Sun, 22 Mar 2020 07:53:22 +0000 (01:53 -0600)]
LU-13379 tests: don't use localrecov for older servers

Don't add the "-o localrecov" mount option to older MDT and OST
mounts, since that option is not supported there.

Fixes: 8bd04b4e5766 ("LU-12722 target: disable recovery for local clients")
Test-Parameters: trivial testlist=runtests serverversion=2.12
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Idc0ba22c9b648d49515f5e0f2d8271c8573ebbe5
Reviewed-on: https://review.whamcloud.com/38022
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-6179 llite: remove LOCKAHEAD_OLD compatibility 09/38109/2
Andreas Dilger [Wed, 1 Apr 2020 01:14:00 +0000 (19:14 -0600)]
LU-6179 llite: remove LOCKAHEAD_OLD compatibility

The OBD_CONNECT_LOCKAHEAD_OLD feature was added for a short time for
compatibility with an implementation of LDLM lockahead that was later
replaced by OBD_CONNECT_LOCKAHEAD2.

Remove the compatibility code for this old implementation that has
been disabled since the 2.13 release.

Also remove other obsolete compatibility code dating back to 2.8.53.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I4444eff180b2c6e2b27d260413f2debbb2ce7057
Reviewed-on: https://review.whamcloud.com/38109
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
21 months agoLU-8454 Remove struct mgs_send_param and its users 06/38106/4
Oleg Drokin [Wed, 1 Apr 2020 00:31:24 +0000 (20:31 -0400)]
LU-8454 Remove struct mgs_send_param and its users

This code has been somewhat dormant since 2.9 and now it's
time to remove it.

Change-Id: I392c29d30e11b4feb362ac2f396a2f687c81c52a
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38106
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
21 months agoLU-13321 tests: force even DNE file distribution 29/38129/5
Andreas Dilger [Fri, 3 Apr 2020 00:54:11 +0000 (18:54 -0600)]
LU-13321 tests: force even DNE file distribution

Force even file creation across DNE-striped directories in sanity
test_160f to avoid random test failures (about 15%) when no files
are created on a specific MDT.

Fixes: 0a1cf8da8069 ("LU-11025 dne: introduce new directory hash type: 'crush'")
Test-Parameters: trivial testlist=sanity env=ONLY=160f,ONLY_REPEAT=50
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I8bead0c20efeda90b9b89f933a022cc18e3ebbe5
Reviewed-on: https://review.whamcloud.com/38129
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-12312 tests: stop running sanity-sec test 31 28/38128/2
James Nunez [Thu, 2 Apr 2020 17:59:32 +0000 (11:59 -0600)]
LU-12312 tests: stop running sanity-sec test 31

sanity-sec test 31 is failing a high percent of time
and the failure is not understood.  Let's stop running
this test, add the test to the ALWAYS_EXCEPT list, until
we have a fix for this issue.

Test-Parameters: trivial testlist=sanity-sec
Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: I07c3cb1b5d12c920f78efb942460608c664000b3
Reviewed-on: https://review.whamcloud.com/38128
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13226 ldiskfs: Add support for SUSE 15 SP2 90/37490/7
Shaun Tancheff [Wed, 12 Feb 2020 20:18:07 +0000 (14:18 -0600)]
LU-13226 ldiskfs: Add support for SUSE 15 SP2

SUSE 15 SP2 kernel is close enough to 5.4.7+ mainline to
use the patch series directly.
Update the configure script to select it.

Test-Parameters: trivial
Cray-bug-id: LUS-8485
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I10e5b9eef6783ac153429be602bbda8d870c46d5
Reviewed-on: https://review.whamcloud.com/37490
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13344 servers: change request timeouts to s32 50/37950/2
James Simmons [Tue, 17 Mar 2020 11:31:08 +0000 (07:31 -0400)]
LU-13344 servers: change request timeouts to s32

In the latest kernels time_t has been removed since time_t has
been a 64 bit value just like time64_t so no need for it anymore.
The field sf_run_time is stored on local media and its expected
to be 32 bit in size so change it to s32 explictly. The fields
the MDT coordinator that are currently time_t are a simple change
to s32 since they represent a time period and not a time stamp.
Lastly just update a comment in llog_swab.c since time_t will no
longer exist but we want to point out time in the llog is 32 bits
in size.

Change-Id: I0849fc9798c191d1fed77f7bba1357a209924418
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37950
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13344 sec: remove time_t usage 42/37942/4
James Simmons [Fri, 20 Mar 2020 23:49:06 +0000 (19:49 -0400)]
LU-13344 sec: remove time_t usage

In the latest kernels time_t has been removed since time_t has
been a 64 bit value just like time64_t so no need for it anymore.
Change ps_sepol_mtime to ktime_t which is the preferred time
format in the linux kernel. For the case of the Lustre GGS code
the fields marked as time_t are timestamps so just change it to
time64_t.

Change-Id: I9f40592d440cc8d68c7b73c0c31d88bcecb3723b
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37942
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Tested-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13344 ptlrpc: change request timeouts to s32 33/37933/6
James Simmons [Fri, 20 Mar 2020 21:40:25 +0000 (17:40 -0400)]
LU-13344 ptlrpc: change request timeouts to s32

In the latest kernels time_t has been removed since time_t has
been a 64 bit value just like time64_t so no need for it anymore.
This means all kernel time keeping are all 64 bits but Lustre
sends 32 bit values, in seconds, for its timeout between nodes.
To keep backwards compatibility as well as distinguish timeouts
from timestamps change the Lustre fields representing timeouts
to a new typedef timeout_t which is a s32. The reason for picking
a signed number is that it makes it easier to detect if an
incorrect timeout was calculated. In the past negative timeouts
have happened which would look like an enormous timeout if its
treated as an unsigned number.

Change-Id: I7491bbac65023c544e8f4a0488b1d07315a739e5
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/37933
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13309 ofd: optimize the brw codepath 95/37795/3
Andrew Perepechko [Fri, 13 Mar 2020 09:44:24 +0000 (12:44 +0300)]
LU-13309 ofd: optimize the brw codepath

1) currently, ofd_commitrw() calls lvbo_update()
from the read path with req == NULL.

The only effect of this call is lvb update from
disk. However, the read request does not update
inode info such as atime/mtime/ctime/i_size, so
there's no need for lvb update.

The comment above the removed code claims that
ofd_preprw_read() updated ondisk atime. In fact,
there's no code in the read path which updates
atime. Atime update was implemented by
obdo_to_inode() before we moved to osd.

We don't seem to suffer from this loss, so
attr_get and lvb update, which currently do nothing,
can be simply dropped.

2) ofd_commitrw_*() calls ofd_object_find()
whereas the corresponding preprw call has not
only received the pointer to the object, but
also keeps a reference on it when exits so
ofd_commitrw_*() has to put it twice.

We don't really need to look up the needed
object twice, just record it in the ofd info
and then take it from there.

Change-Id: If9692906e6c8c4e1254d166620d1ea7e68a933b6
Signed-off-by: Andrew Perepechko <c17827@cray.com>
Cray-bug-id: LUS-8127
Reviewed-on: https://review.whamcloud.com/37795
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13324 llite: page delete race 93/37793/4
Bobi Jam [Tue, 10 Mar 2020 13:12:53 +0000 (21:12 +0800)]
LU-13324 llite: page delete race

Page could be raced by truncate during its deletion by
another thread, check vmpage mapping before accessing it.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I3172f5ffd3928926b16ab6fd7362b05da0c7cfd5
Reviewed-on: https://review.whamcloud.com/37793
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
21 months agoLU-12542 lustre: remove INIT_LIST_HEAD_RCU support. 89/37789/2
Mr NeilBrown [Wed, 4 Mar 2020 03:31:16 +0000 (14:31 +1100)]
LU-12542 lustre: remove INIT_LIST_HEAD_RCU support.

Not all kernels provide INIT_LIST_HEAD_RCU() so it is provided for
older kernels.  But lustre no longer uses this macro and is unlikely
to - it is rarely used at all.

So remove the back-compat support.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I0556e9c75c575ee269f253a90600788747578593
Reviewed-on: https://review.whamcloud.com/37789
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13255 gnilnd: Use wait_var_event_warning() 94/37594/6
Mr NeilBrown [Thu, 7 Nov 2019 06:00:07 +0000 (17:00 +1100)]
LU-13255 gnilnd: Use wait_var_event_warning()

LNet has a recurring pattern of waiting for some variable to
reach a particular value, and generating a warning every second that
it hasn't.  In many cases the warning has a higher priority if the
wait has been for a power-of-2 seconds.

This pattern is now  embodied in
  wait_var_event_warning()

Use that macro in various places in gnilnd.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I7be82a175c7b1b8da4df99199378e7af5328e0e7
Reviewed-on: https://review.whamcloud.com/37594
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13157 mdd: migrate readlink from wrong place 85/37285/4
Lai Siyao [Mon, 20 Jan 2020 04:23:45 +0000 (12:23 +0800)]
LU-13157 mdd: migrate readlink from wrong place

In osd_read(), if symlink name buf length is smaller than i_size,
return -EOVERFLOW, and compare inline data length with i_size
instead of buflen.

Updated sanity.sh 230b.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ia13b1f1079efc4ebd22ec400f1a909ff7ec2095d
Reviewed-on: https://review.whamcloud.com/37285
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
21 months agoLU-9091 procfs: remove old string parsing routines 75/37275/4
Andreas Dilger [Tue, 24 Mar 2020 13:57:39 +0000 (09:57 -0400)]
LU-9091 procfs: remove old string parsing routines

Remove the llprocfs_str_with_units_to_s64(), lu_str_to_s64(),
llprocfs_str_with_units_to_u64(), and lu_str_to_u64() functions.
All new code should use sysfs_memparse() to parse sizes from
userspace.

Mark patch forbuildonly so that it does not land before we have
a chance to remove any patches with users of these functions.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I6dc321e60eb587ef25652f4b5ae8fa478d3ebbe5
Reviewed-on: https://review.whamcloud.com/37275
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13004 net: discard LNET_MD_IOVEC 74/36974/6
Mr NeilBrown [Thu, 21 Nov 2019 04:26:04 +0000 (15:26 +1100)]
LU-13004 net: discard LNET_MD_IOVEC

This flag is now never set, so discard it.  lnet_md memory descriptors
are either a single virtual address, or a list of bvec.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I9b2280f801108e5d9fc718c90c83692042991f12
Reviewed-on: https://review.whamcloud.com/36974
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-12292 lnet: keep health even if recovery failed 21/36921/11
Amir Shehata [Tue, 3 Dec 2019 17:22:03 +0000 (09:22 -0800)]
LU-12292 lnet: keep health even if recovery failed

Don't decrement the interface's health value when recovery
message fails. If we've already determined that an interface
is unhealthy, there is no need to continue decrementing
it's health every 1 second. It'll take too long to come back
into service when it becomes healthy.

Clean up where health is decremented in order not to have
repetitive decrements. No need to decrement in lnet_notify()
because in order for the LND to call this an existing transmit
must've failed. This means a message has already failed which
will result in the health being decremented.

When a recovery send fails make sure to flag the recovery as
failed because there is no reply expected in this case.

Test-parameters: trivial

Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: Ifb3500a77a5a5be51e7079269c8ddba85ed0c2a7
Reviewed-on: https://review.whamcloud.com/36921
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-12303 lnet: recover health at same rate as dec 20/36920/9
Amir Shehata [Tue, 3 Dec 2019 01:09:07 +0000 (17:09 -0800)]
LU-12303 lnet: recover health at same rate as dec

When there is a failure to send to or over an interface the
interface's health value is decremented by lnet_health_sensitivity.
Originally, when it recovers the health value goes up by 1.
This patch makes incrementing and decrementing health value
symmetrical, by lnet_health_sensitivity.

In this way if a site wants to stop using and start using an interface
quickly, then it can set lnet_health_sensitivity to a large value
compared to the health value maximum, which is hard coded to 1000.
For example setting lnet_health_sensitivity to 500 will reduce the
health value of an interface to 0 after two failed sends and
reset it to maximum health value after two successful sends.

Test-parameters: trivial

Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: Ib5cedb063d9ccf79c574edac291551f8c94bcce4
Reviewed-on: https://review.whamcloud.com/36920
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-13028 lnet: advertise discovery when toggled 19/36919/9
Amir Shehata [Mon, 2 Dec 2019 01:05:24 +0000 (17:05 -0800)]
LU-13028 lnet: advertise discovery when toggled

When discovery is toggled send a push message to all peers.
When a node receives a push notification that discovery is
turned off while previously it was on, then delete the peer
information. If the peer is a router, recreate the routes.

Test-parameters: trivial

Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: I58f9f42542e4c05763128d7c9d23108c3e7f13a3
Reviewed-on: https://review.whamcloud.com/36919
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-8130 lu_object: use RCU to free lu_object_header 65/37965/2
Mr NeilBrown [Wed, 18 Mar 2020 02:55:19 +0000 (13:55 +1100)]
LU-8130 lu_object: use RCU to free lu_object_header

Any struct containing an lu_object_header is now freed using
call_rcu() or rcu_kfree() when freed by loo_object_free.

This will allow RCU protocols to protect lookups once we
switch the lu_object cache to rhashtable in a future patch.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ib0e1134ae2ac73532d6f953ff4510076f1d8a78a
Reviewed-on: https://review.whamcloud.com/37965
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-12780 quota: don't use ptlrpc_thread for qsd_upd_thread() 67/36267/11
Mr NeilBrown [Wed, 23 Oct 2019 00:30:51 +0000 (11:30 +1100)]
LU-12780 quota: don't use ptlrpc_thread for qsd_upd_thread()

Instead of ptlrpc_thread, use native kthread functionality.

- for startup, perform allocations before starting the thread,
  and use a completion to ensure thread function runs before
  kthread_stop() is ever called, so cleanup is guaranteed to
  happen.
- for shutdown, use kthread_stop/kthread_should_stop
- for signalling the thread, use wake_up_process.  The thread
  sets TASK_IDLE while checking if there is anything to do,
  and TASK_RUNNING when it finds something to work on, so
  the schedule_timeout() only blocks if there was nothing to do.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I2ec2e28320e14251f342b8749a1a738f136f3575
Reviewed-on: https://review.whamcloud.com/36267
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
21 months agoLU-12390 tests: customise mdsrate tests 68/35068/4
Elena Gryaznova [Wed, 5 Jun 2019 11:46:18 +0000 (14:46 +0300)]
LU-12390 tests: customise mdsrate tests

Patch adds the following customizations:
  set custom layout for filesystem root
  directory by specifying fs_STRIPEPARAMS
  and
  set the custom layout for mdsrate test's
  working directory BASEDIR by specifying
  mdsrate_STRIPEPARAMS.

Test-Parameters: trivial testlist=performance-sanity
Signed-off-by: Elena Gryaznova <c17455@cray.com>
Cray-bug-id: LUS-7249
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Change-Id: I28524c203f86e7e94a4db47a8d8c4b3518883600
Reviewed-on: https://review.whamcloud.com/35068
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-11596 tests: wait for grant to stop changing 76/37876/3
Andreas Dilger [Wed, 11 Mar 2020 04:52:35 +0000 (22:52 -0600)]
LU-11596 tests: wait for grant to stop changing

Wait for the client and server grant to stop changing in sanity
test-42d, test_64[acd] to avoid intermittent failures.

Test-Parameters: trivial testlist=sanity env=ONLY=64a,ONLY_REPEAT=100
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I3ef3a93d04e73ffb0098f712373c1462c53ebbe5
Reviewed-on: https://review.whamcloud.com/37876
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 months agoLU-11025 lmv: simplify name to stripe mapping 11/37711/4
Lai Siyao [Sat, 15 Feb 2020 02:48:59 +0000 (10:48 +0800)]
LU-11025 lmv: simplify name to stripe mapping

Handle layout change internally when mapping name to stripe:
* Move layout changing related code into lmv name to stripe mapping
  so callers doesn't need to take care of the internals.
* lmv_name_to_stripe_index() maps name in new layout, and
  lmv_name_to_stripe_index_old() in old layout.
* rename lmv_migrate_existence_check() to lmv_old_layout_lookup()
  to support directory restripe in the future.
* support layout changing directory in LFSCK.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Icf8bda5db884784f761a2d373a6f81d7e13f525f
Reviewed-on: https://review.whamcloud.com/37711
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>