Whamcloud - gitweb
fs/lustre-release.git
22 months agoLU-15724 osp: wakeup all precreate threads 05/47005/5
Alexander Boyko [Wed, 6 Apr 2022 09:06:46 +0000 (05:06 -0400)]
LU-15724 osp: wakeup all precreate threads

Number of threads could sleep at osp_precreate_reserve() and
wait objects from OST. When MDT stops Lustre should wakeup
all threads. When opd_pre_recovering is set any wakeup of
opd_pre_user_waitq is useless. Failover of MDT does not produce
disconnect event, only inactive, so osp_precreate_cleanup_orphans()
can not be awakened.

LustreError: 0-0: Forced cleanup waiting for mdt-kjcf05-MDT0001_UUID
namespace with 46 resources in use, (rc=-110)

 schedule_timeout at ffffffff8e551cd3
 osp_precreate_reserve at ffffffffc17d2d83 [osp]
 osp_declare_create at ffffffffc17c7eb9 [osp]
 lod_sub_declare_create at ffffffffc156415b [lod]
 lod_qos_declare_object_on at ffffffffc155bf42 [lod]
 lod_ost_alloc_rr.constprop.23 at ffffffffc155db2f [lod]
 lod_qos_prep_create at ffffffffc15630a6 [lod]
 lod_declare_instantiate_components at ffffffffc154b237 [lod]

HPE-bug-id: LUS-10750
Signed-off-by: Alexander Boyko <alexander.boyko@hpe.com>
Change-Id: If0164cfbecb1e358d9857421cb234559dc8cecbc
Reviewed-on: https://review.whamcloud.com/47005
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15132 mdc: Use early cancels for hsm requests 81/47181/5
Etienne AUJAMES [Mon, 2 May 2022 12:27:17 +0000 (14:27 +0200)]
LU-15132 mdc: Use early cancels for hsm requests

HSM RELEASE and RESTORE requests take EX layout lock on the MDT side.
So the client can use early cancel for its local lock on the resource
to limit the contention (mdt side).

This patch does not pack ldlm request inside the hsm request because
the field (RMF_DLM_REQ) does not exist in the request. Adding this
field inside the request would break compatibility with _old_ servers.

Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I30a57b4855c28eef9c55a9645d3b6c491f962b13
Reviewed-on: https://review.whamcloud.com/47181
Reviewed-by: Nikitas Angelinas <nikitas.angelinas@hpe.com>
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>
22 months agoLU-13363 lod: do object allocation in OST pool 36/38136/17
Emoly Liu [Thu, 14 Apr 2022 16:04:24 +0000 (12:04 -0400)]
LU-13363 lod: do object allocation in OST pool

Currently, the ltd->ltd_qos.lq_same_space boolean that decides
whether the LOD QOS allocator is active for an allocation or not
is tracked for the entire LOV. But when a pool is specified, this
judgement should be tracked on a per-pool basis.

sanity.sh test_116c is added to verify this patch.

Test-Parameters: ostcount=6 testlist=sanity env=ONLY=116c
Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Change-Id: I463d5927c7a9c9171483615d2cec629ec10dc666
Reviewed-on: https://review.whamcloud.com/38136
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15800 ofd: take a read lock for fallocate 68/47268/5
Alex Zhuravlev [Tue, 10 May 2022 07:48:55 +0000 (10:48 +0300)]
LU-15800 ofd: take a read lock for fallocate

there is no need to take an write (exclusive) object's
lock for fallocate - we just need to serialize fallocate
vs destroy, all internal structures should be protected
by OSD and disk filesystem like the write path does.

Fixes: cdaaa87f6b ("LU-14214 ofd: fix locking in ofd_object_fallocate()")
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I65986745865ee329c5257a7efca5e79403830608
Reviewed-on: https://review.whamcloud.com/47268
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
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>
22 months agoLU-15718 lnet: improve lnet_selftest speed 02/47002/4
Alexey Lyashkov [Wed, 6 Apr 2022 05:13:46 +0000 (08:13 +0300)]
LU-15718 lnet: improve lnet_selftest speed

lets replace a global spinlock with atomic variables,
to avoid cpu power limit in testing.

Test-Parameters: trivial testlist=lnet-selftest
HPE-bug-id: LUS-10812
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Change-Id: Ib12a3b3fe2fe300354e5a7c502bc6f5165e7d05c
Reviewed-on: https://review.whamcloud.com/47002
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15832 lod: clear .do_index_ops in striping free 56/47256/2
Lai Siyao [Thu, 28 Apr 2022 14:48:01 +0000 (10:48 -0400)]
LU-15832 lod: clear .do_index_ops in striping free

LDLM lock can guarantee LOD object directory striping is safe to
access, but lod_striping_free_nolock() should clear .do_index_ops,
otherwise upon some failure the directory striping is freed, while a
subsequent dt_try_as_dir() skips striping initialization, and call
.do_index_ops directly, which will cause crash.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ib94a4ef2f8bf5f0d34521abff77d8be46ecbf428
Reviewed-on: https://review.whamcloud.com/47256
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
22 months agoLU-15776 tgt: fix transaction handling in tgt_brw_write() 71/47371/3
Mikhail Pershin [Tue, 17 May 2022 09:57:28 +0000 (12:57 +0300)]
LU-15776 tgt: fix transaction handling in tgt_brw_write()

Hotfix to prevent possible data loss during WRITE replay.
Since commit f0f92773ee18 from LU-14187 the obd_commitrw()
may restart write transaction in OFD and MDT. That causes
transaction number to be assigned multiple times if such
restart happens. Without flag tti_mult_trans the first
transaction number is stored only so later one could remain
not applied causing data loss after recovery.

Patch sets tti_mult_trans for tgt_brw_write() so the latest
transaction number will be used as request transno.

Fixes: f0f92773ee ("LU-14187 osd-ldiskfs: fix locking in write commit")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I364b478591942be5562c3e98ee6e6aa487f3e0c5
Reviewed-on: https://review.whamcloud.com/47371
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wangshilong1991@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15887 test: add always_except() 52/47452/3
John L. Hammond [Wed, 25 May 2022 14:07:37 +0000 (09:07 -0500)]
LU-15887 test: add always_except()

In test-framework.sh, add a new function (always_except()) to replace
manual manipulation of $ALWAYS_EXECPT. Convert sanity.sh to use
always_except() and add a line to contrib/scripts/spelling.txt to
suggest its use.

Test-Parameters: trivial
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I1b39fe9555bab59e70db00cef73d13102668500a
Reviewed-on: https://review.whamcloud.com/47452
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15722 osd-ldiskfs: fix IO write gets stuck for 64K PAGE_SIZE 04/47004/2
Xinliang Liu [Wed, 6 Apr 2022 08:06:33 +0000 (08:06 +0000)]
LU-15722 osd-ldiskfs: fix IO write gets stuck for 64K PAGE_SIZE

This fixes below IO write stuck issue:
-----
[606895.151765] LustreError:
334886:0:(ofd_io.c:1389:ofd_commitrw_write()) lustre-OST0000: restart IO
write too many times: 10000
[606895.207345] LustreError:
334886:0:(ofd_io.c:1389:ofd_commitrw_write()) Skipped 8 previous similar
messages
-------

Which goes into an infinite loop:
ofd_commitrw_write()->osd_write_commit()->osd_ldiskfs_map_inode_pages()
    ->ldiskfs_map_blocks()->ofd_commitrw_write()

The cause is that:
For 64K PAGE_SIZE blocks allocation/mapping. m_lblk should be the
first un-allocated block if m_lblk points at an already allocated
block when create = 1, ldiskfs_map_blocks() will just return with
already allocated blocks and without allocating any new requested
blocks for the extent.

This stuck issue won't happen on 4K PAGE_SIZE. Because for
PAGE_SIZE = blocksize case, if m_lblk points at an already
allocated block it will point at an un-allocated block in next
restart transaction, because the already mapped block/page will
be filtered out in next restart transaction via flag
OBD_BRW_DONE in osd_declare_write_commit().

Change-Id: Iadba0be8875a15a2e2f158ec9571f5ece5637ae0
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Reviewed-on: https://review.whamcloud.com/47004
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15658 lod: ost list and pool name conflict 67/46967/3
Vitaly Fertman [Wed, 30 Mar 2022 19:11:42 +0000 (22:11 +0300)]
LU-15658 lod: ost list and pool name conflict

If the OST list is given on setstripe with the -o option, the pool is
unconditionally dropped even if all the OSTs are in. Let the pool stay
in this case.

Also, if the start index given on setstripe with the -i option is out
of the pool, make it similar to the -o option - drop the pool.

HPE-bug-id: LUS-10868
Fixes: b384ea39e5 ("LU-14480 pool: wrong usage with ost list")
Signed-off-by: Vitaly Fertman <vitaly.fertman@hpe.com>
Change-Id: I718c237e273689048eb74044eea73de6c212395e
Reviewed-on: https://review.whamcloud.com/46967
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Etienne AUJAMES <eaujames@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15683 ofd: proper initialize filter_fid in ofd fallocate 19/46919/3
Bobi Jam [Thu, 24 Mar 2022 08:19:31 +0000 (16:19 +0800)]
LU-15683 ofd: proper initialize filter_fid in ofd fallocate

Intialize filter_fid buffer and call xattr set XATTR_NAME_FID properly
in ofd_object_fallocate().

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Ied573c39dde77f935622e9fbedb2d71eb3bd8f5d
Reviewed-on: https://review.whamcloud.com/46919
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15519 quota: fallocate does not increase projectid usage 76/46676/7
Arshad Hussain [Mon, 14 Feb 2022 08:36:47 +0000 (14:06 +0530)]
LU-15519 quota: fallocate does not increase projectid usage

fallocate() was not accounting for projectid quota usage.
This was happening due to two reasons. 1) the projectid
was not properly passed to md_op_data in ll_set_project()
and 2) the OBD_MD_FLPROJID flag was not set receive the
projctid.

This patch addresses the above reasons.

Test-case: sanity-quota/78a added

Fixes: 48457868a02a ("LU-3606 fallocate: Implement fallocate preallocate operation")
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I3ed44e7ef7ca8fe49a08133449c33b62b1eff500
Reviewed-on: https://review.whamcloud.com/46676
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15487 mdd: print FID in mdd_dir_page_build() error 68/46368/4
Andreas Dilger [Wed, 26 Jan 2022 23:33:27 +0000 (16:33 -0700)]
LU-15487 mdd: print FID in mdd_dir_page_build() error

Print the MDT name and FID in mdd_dir_page_build() when an error
is hit.  Because this changes the callback function signature,
also update dt_index_page_build() to print a more useful message.

Add OBD_FAIL_MDS_DIR_PAGE_WALK to allow triggering this codepath
to see if this is the source of problems in error handling.

Minor code style and whitespace cleanups in related functions.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ic475f4a2c775871ff5af59a47e0966ba3eed7013
Reviewed-on: https://review.whamcloud.com/46368
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15284 llite: access lli_lsm_md with lock in all places 55/46355/4
Lai Siyao [Fri, 28 Jan 2022 05:08:41 +0000 (00:08 -0500)]
LU-15284 llite: access lli_lsm_md with lock in all places

lli_lsm_md should be accessed with lock in all places. Among all the
changes, ll_rease_page() is inside lock already, except statahead
code.

Test-Parameters: mdscount=2 mdtcount=4 testlist=racer,racer,racer
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I1e09402812ce51ce7ab80d9529d488cb5b2879ee
Reviewed-on: https://review.whamcloud.com/46355
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15278 lod: distinguish DIR/REGULAR lod_object members 10/45710/11
Bobi Jam [Thu, 2 Dec 2021 10:34:42 +0000 (18:34 +0800)]
LU-15278 lod: distinguish DIR/REGULAR lod_object members

In lod_striping_free_nolock(), we need to distinguish lod_object
type, since DIR/REGULAR lod_object structure share the same memory
region, it could accidently free some unintended memory if it treat
DIR lod_object as REGULAR one, or vice versa.

Fixes: 6a20bdcc608b ("LU-11376 lov: new foreign LOV format")
Fixes: fdad38781ccc ("LU-11376 lmv: new foreign LMV format")
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I2d4c563725b35f7a75f0f1fbf9c1d35b1799eff4
Reviewed-on: https://review.whamcloud.com/45710
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>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 socklnd: switch ksocknal_del_peer to lnet_processid 23/44623/4
Mr NeilBrown [Wed, 9 Jun 2021 00:38:48 +0000 (10:38 +1000)]
LU-10391 socklnd: switch ksocknal_del_peer to lnet_processid

ksocknal_del_peer now takes a pointer to a lnet_processid,
with room for a large address.
A NULL means "ANY NID, AND PID".
The "ip" argument was completely unused, so has been removed.

This was the last use of 'struct lnet_process_id' in ksocklnd.

Test-Parameters: trivial testlist=sanity-lnet
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I2f3879fdafc9b1effd540af3644febf0d06eb5e2
Reviewed-on: https://review.whamcloud.com/44623
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 socklnd: large processid for ksocknal_get_peer_info 22/44622/4
Mr NeilBrown [Wed, 9 Jun 2021 00:27:38 +0000 (10:27 +1000)]
LU-10391 socklnd: large processid for ksocknal_get_peer_info

Have ksocknal_launch_packet() report a 'struct lnet_processid'
with a large address.

Test-Parameters: trivial testlist=sanity-lnet
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I6dd4b11e0361d893dea519287448028ca0a1ab97
Reviewed-on: https://review.whamcloud.com/44622
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 socklnd: pass large processid to ksocknal_add_peer 21/44621/4
Mr NeilBrown [Tue, 8 Jun 2021 00:52:25 +0000 (10:52 +1000)]
LU-10391 socklnd: pass large processid to ksocknal_add_peer

Teach ksocknal_add_peer() to handle large-address processid, and now
ksocknal_launch_packet() can support IPv6 addresses as well as IPv4.

Test-Parameters: trivial testlist=sanity-lnet
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I90655b8d6e1a2e9fc38a7bf9d492542f76086c70
Reviewed-on: https://review.whamcloud.com/44621
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 lnet: switch LNetIsPeerLocal() to take 16-byte addr 21/43621/11
Mr NeilBrown [Fri, 10 Jul 2020 05:58:29 +0000 (15:58 +1000)]
LU-10391 lnet: switch LNetIsPeerLocal() to take 16-byte addr

LNetIsPeerLocal() now takes a 'struct lnet_nid'

Test-Parameters: trivial
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Id72a92cda510de6864c82d88912c582745cc9727
Reviewed-on: https://review.whamcloud.com/43621
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 lnet: change LNetGet to take 16byte nid and pid. 20/43620/12
Mr NeilBrown [Tue, 30 Nov 2021 15:46:00 +0000 (10:46 -0500)]
LU-10391 lnet: change LNetGet to take 16byte nid and pid.

"self" is now passed to LNetGet as a pointer to a 16-byte-addr nid, or
NULL for "ANY".  "target" is passed as a 16-bytes-addr process_id.

Test-Parameters: trivial
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I8e0fcd442d5195991b799a8db3ec8030c81f9400
Reviewed-on: https://review.whamcloud.com/43620
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 lnet: convert LNetPut to take 16byte nid and pid. 19/43619/12
Mr NeilBrown [Fri, 10 Jul 2020 05:19:38 +0000 (15:19 +1000)]
LU-10391 lnet: convert LNetPut to take 16byte nid and pid.

LNetPut() now takes a 16byte nid for self and similar process_id for
target.

Test-Parameters: trivial
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I240caf6fb8b02b1814b9d4883aceda33894786a4
Reviewed-on: https://review.whamcloud.com/43619
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 lnet: Change LNetDist to work with struct lnet_nid 18/43618/12
Mr NeilBrown [Fri, 10 Jul 2020 05:04:03 +0000 (15:04 +1000)]
LU-10391 lnet: Change LNetDist to work with struct lnet_nid

LNetDist now takes and returns 'struct lnet_nid'
lustre_uuid_to_peer() is also updated.

The 'dst' and 'src' parameters to LNetDist are now both pointers, and
that can point to the same 'struct lnet_nid'.  Code needs to be
careful not to set *src until after the last use of *dst.

Test-Parameters: trivial
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I267f3333e3164778a7df39d6b90f0a9a913fcdcf
Reviewed-on: https://review.whamcloud.com/43618
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 lnet: alter lnet_drop_rule_match() to take lnet_nid 17/43617/11
Mr NeilBrown [Fri, 10 Jul 2020 02:39:17 +0000 (12:39 +1000)]
LU-10391 lnet: alter lnet_drop_rule_match() to take lnet_nid

The local nid passed to lnet_drop_rule_match() is now a 16-byte nid.
Various support functions are also changed to embrace 'struct
lnet_nid'.

Test-Parameters: trivial
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I738bff9cfc8c5a70c736639fdd64a66d2aded186
Reviewed-on: https://review.whamcloud.com/43617
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10391 lnet: change LNetPrimaryNID to use struct lnet_nid 16/43616/12
Mr NeilBrown [Thu, 27 Jan 2022 00:38:21 +0000 (19:38 -0500)]
LU-10391 lnet: change LNetPrimaryNID to use struct lnet_nid

Rather than taking and returning a 4-byte-addr nid, LNetPrimaryNID now
takes a pointer to a struct lnet_nid, and updates it in-place.

Test-Parameters: trivial
Test-Parameters: env=SHARED_KEY=true testlist=sanity,sanity-sec
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Change-Id: I74f193e5c533125c282f230d272a506129baa365
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/43616
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-14627 utils: quiet spurious lustre_rmmod message 16/47116/3
Andreas Dilger [Fri, 22 Apr 2022 03:05:13 +0000 (21:05 -0600)]
LU-14627 utils: quiet spurious lustre_rmmod message

Quiet unnecessary "LNET ready to unload" message from lustre_rmmod.

Lustre-change: https://review.whamcloud.com/47116
Lustre-commit: TBD (from ee7aba2beabbf983ccffe8e4881e792943a15b09)

Fixes: 32304d863ae98 ("LU-14627 tests: Create unload_modules_local")
Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I02efa36bbc1a3f4ab63767176ef53956dcafa589
Reviewed-on: https://review.whamcloud.com/47116
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15000 llog: read canceled records in llog_backup 52/46552/3
Etienne AUJAMES [Fri, 18 Feb 2022 12:26:00 +0000 (13:26 +0100)]
LU-15000 llog: read canceled records in llog_backup

llog_backup() do not reproduce index "holes" in the generated copy.
This could result to a llog copy indexes different from the source.
Then it might confuse the configuration update mechanism that rely on
indexes between the MGS source and the target copy.

This index gaps can be caused by "lctl --device MGS llog_cancel".

This patch add "raw" read mode to llog_process* to read canceled
records. So now llog_backup is able to reproduce an exact copy of
the original.

Signed-off-by: Etienne AUJAMES <etienne.aujames@cea.fr>
Change-Id: I811e23de8f4545bed36a44fedc2638d7418830dd
Reviewed-on: https://review.whamcloud.com/46552
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Dominique Martinet <qhufhnrynczannqp.f@noclue.notk.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: DELBARY Gael <gael.delbary@cea.fr>
Reviewed-by: Stephane Thiell <sthiell@stanford.edu>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15542 osd-ldiskfs: exclude EA inode from processing 86/46486/4
Alexey Lyashkov [Thu, 10 Feb 2022 12:46:00 +0000 (15:46 +0300)]
LU-15542 osd-ldiskfs: exclude EA inode from processing

EA inode is ldiskfs internal object and this should be
excluded at any osd access.
Panic fixed by this change because iterator will return
an error when tries to access to the ea inode.

osd_ea_fid_get()) Process leaving (rc=18446744073709551614 : -2
osd_it_ea_rec()) Process leaving (rc=18446744073709551614 : -2)
osd_it_ea_next()) Process entered

HPe-bug-id: LUS-10683
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Change-Id: I73e5325721ae28ea380e9d216c6c6cf7fa0ac4ea
Reviewed-on: https://review.whamcloud.com/46486
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15502 mdt: cleanup whitespace in mdt_open.c 85/46385/3
Andreas Dilger [Sun, 30 Jan 2022 11:58:10 +0000 (04:58 -0700)]
LU-15502 mdt: cleanup whitespace in mdt_open.c

Change spaces to tabs for indent and do not align local variables.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1b89ffd54d41ce42738b061738f990d0326bf9af
Reviewed-on: https://review.whamcloud.com/46385
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15189 lnet: fix memory mapping. 82/45482/12
Alexey Lyashkov [Mon, 7 Feb 2022 15:02:14 +0000 (18:02 +0300)]
LU-15189 lnet: fix memory mapping.

Nvidia GDS have a bug which caused incorrect page type detect.
It may return an GPU flag for the kmalloc buffer (ptlrpc_message
in my case).
To workaround this - Whamcloud have both mapping calls, but it's
costly and caused an extra RDMA operations as ko2iblnd trust
an msg_rdma_force flag.
Lets drop extra Nvidia calls and check just an real "user" pages
or GPU flag.

HPe-bug-id: LUS-10520
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Change-Id: I5d70c5e0630b0f16e130a7db0385de2443c11a63
Reviewed-on: https://review.whamcloud.com/45482
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15189 build: add GDS configure options 80/45480/10
Alexey Lyashkov [Thu, 3 Mar 2022 16:52:41 +0000 (19:52 +0300)]
LU-15189 build: add GDS configure options

add ability to specify GDS patch, pickup an GDS API directly from the
GDS sources.

Test-Parameters: trivial
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Change-Id: Iccc52765540cc90c6a69af34d230ed24b2eb996a
Reviewed-on: https://review.whamcloud.com/45480
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-14642 test: add fsx mirror file test mode 73/43473/10
Bobi Jam [Wed, 28 Apr 2021 05:26:18 +0000 (13:26 +0800)]
LU-14642 test: add fsx mirror file test mode

- add fsx mirror file test mode with "-M" option so that fsx can exert
  its IO to FLR file as well as extend/split/resync the FLR file.

- add sanity-flr test_70b() to test fsx with flrmode.

- fix a bug in "lfs mirror verify" to accomodate max mirror count
  instead of (max - 1) mirrors.

- improve "lfs mirror verify -v" print proper data range of its crc-32
  checksum values.

Test-Parameters: trivial testlist=sanity-flr env=ONLY=100,FSXNUM=10000
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Ib55c7b25dcd82fa0b197ad21268b16c82aab5da9
Reviewed-on: https://review.whamcloud.com/43473
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-10073 tests: re-enable lnet selftest smoke test for PPC + ARM 57/38857/15
James Simmons [Mon, 10 Jan 2022 23:43:56 +0000 (18:43 -0500)]
LU-10073 tests: re-enable lnet selftest smoke test for PPC + ARM

LNet selftest has failed on platforms with 64K pages. Recent work
by Alexy Lyashkov should have resolved these issues. Lets enable
the lnet selftest to valid these changes.

Test-Parameters: trivial clientdistro=el8.5 clientarch=aarch64 testlist=lnet-selftest
Test-Parameters: trivial clientdistro=el8.5 clientarch=ppc64le testlist=lnet-selftest

Change-Id: I97684101ea2f90bb41f452955d5f864ca35d61ec
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/38857
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: xinliang <xinliang.liu@linaro.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15404 ldiskfs: port truncate fix to Ubuntu 20 HWE 80/46480/2
James Simmons [Tue, 8 Feb 2022 17:56:18 +0000 (10:56 -0700)]
LU-15404 ldiskfs: port truncate fix to Ubuntu 20 HWE

A fixed landed for the LU-15404 bug which a truncate vs setxattr
race caused a kernel crash. This fix wasn't added in for new
Ubuntu 20 HWE kernels and the 5.10 kernel.

Change-Id: I43b33cd28335d1bc5796aa6651ecf847b4ea24e6
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/46480
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15858 sec: reinstate null encryption for file names 55/47355/4
Sebastien Buisson [Mon, 2 May 2022 16:00:37 +0000 (18:00 +0200)]
LU-15858 sec: reinstate null encryption for file names

Reinstate null encryption for file names by adding a new llite
parameter named 'enable_filename_encryption', set to 0 by default.
When this parameter is 0, new empty directories configured as
encrypted ignore the filenames_encryption_mode and use
LLCRYPT_MODE_NULL instead, which is a no-op. This LLCRYPT_MODE_NULL
mode is inherited for all subdirectories and files.
When this parameter is 1, new empty directories configured as
encrypted use the normal encryption mode.

To set this parameter globally for all clients, do on the MGS:
mgs# lctl set_param -P llite.*.enable_filename_encryption=0

Also update sanity-sec test_54 to exercise the new parameter
'enable_filename_encryption'.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I9d726ba26cc91a51690d59a81efe3eb98ee2995c
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47355
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15848 ldiskfs: escape encrypted file names 09/47309/8
Sebastien Buisson [Wed, 11 May 2022 13:42:29 +0000 (15:42 +0200)]
LU-15848 ldiskfs: escape encrypted file names

When a Lustre MDT is mounted as ldiskfs, the names of the encrypted
files have to be escaped to avoid breaking the shell.
On CentOS 7, the LDISKFS_ENCRYPT_FL flag does not exist. So we add it,
and when the target is mounted as ldiskfs (LDISKFS_MOUNT_DIRDATA flag
not present) we critical-encode encrypted file names before
presentation. And conversely, we critical-decode names upon lookup.
On CentOS 8, the LDISKFS_ENCRYPT_FL flag exists. The fscrypt functions
from kernel 4.18 are also wired up, but they all refer to -EOPNOTSUPP
or equivalent, so they cannot be used to present usable names. So when
the target is mounted as ldiskfs (LDISKFS_MOUNT_DIRDATA flag not
present) we proceed to critical-encoding of encrypted file names
before presentation, and to critical-decoding upon lookup.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iaca467eaa233be8142356efa822962953754c2ce
Reviewed-on: https://review.whamcloud.com/47309
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-14541 llite: Check vmpage in releasepage 62/47262/12
Patrick Farrell [Thu, 12 May 2022 18:53:08 +0000 (14:53 -0400)]
LU-14541 llite: Check vmpage in releasepage

We cannot release a page if the vmpage reference count is
>1, otherwise we will detach a vmpage from Lustre when the
page is still referenced in the VM.

This creates a situation where page discard for lock
cancellation will not find the page, so we can get stale
data reads.

This re-introduces the LU-12587 issue where direct I/O on
a client falls back to buffered I/O if there are pages in
cache, since it cannot flush them.  This is annoying but
not a huge problem.

Fixes: e59f0c9a245f ("LU-12587 llite: don't check vmpage refcount in ll_releasepage()")
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I3aa1cd7330f5e7d1ba2ddb0c12779aa22f3d70b7
Reviewed-on: https://review.whamcloud.com/47262
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
22 months agoLU-14541 llite: add rw_seq_cst_vs_drop_caches 43/47243/6
John L. Hammond [Fri, 6 May 2022 18:54:13 +0000 (13:54 -0500)]
LU-14541 llite: add rw_seq_cst_vs_drop_caches

Add a reproducer (rw_seq_cst_vs_drop_caches) for the read/write vs
drop_caches sequnetial consistency violation described in
LU-14541. Add an always excepted test (sanityn test_16f) to run
rw_seq_cst_vs_drop_caches.

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I557ae7386b38214110a4d85ba0515e95fed7a11e
Reviewed-on: https://review.whamcloud.com/47243
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>
22 months agoLU-14541 llite: reenable fast_read by default 98/47298/4
John L. Hammond [Wed, 11 May 2022 18:09:14 +0000 (13:09 -0500)]
LU-14541 llite: reenable fast_read by default

Reenable fast_read by default.

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I9985beb88d13d21ee538c632fc288470a58b0257
Reviewed-on: https://review.whamcloud.com/47298
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
22 months agoLU-15876 test: restore missing spaces in ALWAYS_EXCEPT 06/47406/2
John L. Hammond [Thu, 19 May 2022 21:01:51 +0000 (16:01 -0500)]
LU-15876 test: restore missing spaces in ALWAYS_EXCEPT

In sanity-flr, restore missing spaces in ALWAYS_EXCEPT.

Fixes: a45fe93cd8 ("LU-14765 test: disable sanity-flr/44c")
Test-Parameters: trivial testlist=sanity-flr fstype=zfs
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Id2fa88b72d021cf114a80ae7dbd1f80bfb31a8b2
Reviewed-on: https://review.whamcloud.com/47406
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-14765 test: disable sanity-flr/44c 74/44074/7
Bobi Jam [Fri, 3 Sep 2021 04:01:59 +0000 (12:01 +0800)]
LU-14765 test: disable sanity-flr/44c

file blocks number accounting does not include blocks occupied by
multiple mirrors, disable the test for now.

Test-Parameters: trivial
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I1a5d7e0c203d5c7dc0da53ce6c020795bf17b9fc
Reviewed-on: https://review.whamcloud.com/44074
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>
23 months agoLU-13578 test: sleep longer in sanity test_39 46/47346/2
John L. Hammond [Fri, 13 May 2022 14:10:59 +0000 (09:10 -0500)]
LU-13578 test: sleep longer in sanity test_39

In sanity test_39r(), sleep for 2 * atime_diff rather than atime_diff + 1.

Test-Parameters: trivial testlist=sanity env=ONLY=39r,ONLY_REPEAT=50
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Ied508e12c848f6935d2317fb86bddc5341a6156e
Reviewed-on: https://review.whamcloud.com/47346
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-11170 test: increase time limit in sanity test_415 41/47341/4
John L. Hammond [Fri, 13 May 2022 12:29:59 +0000 (07:29 -0500)]
LU-11170 test: increase time limit in sanity test_415

In sanity test_415() double the time limit on renaming 500
files. Really we should not be doing arbitrary performance tests using
VMs on oversubscribed test nodes but whatever.

Test-Parameters: trivial testlist=sanity env=ONLY=415,ONLY_REPEAT=10
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Ie2677df00f13ffc85d21ceba5ba7115fff6f0980
Reviewed-on: https://review.whamcloud.com/47341
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
23 months agoLU-15757 test: disable sanityn test_102() for zfs 11/47311/3
John L. Hammond [Thu, 12 May 2022 13:12:10 +0000 (08:12 -0500)]
LU-15757 test: disable sanityn test_102() for zfs

sanityn test_102() on zfs causes clients to crash on umount about half
the time. Disable this test until this can be sorted out.

Test-Parameters: trivial testlist=sanityn fstype=zfs mdtcount=4
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: If9f7c77f8c68eee88b3f050fc26c42c21828e2c9
Reviewed-on: https://review.whamcloud.com/47311
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
23 months agoLU-15830 mdt: mkdir to lookup target name 26/47226/4
Alex Zhuravlev [Fri, 6 May 2022 06:49:56 +0000 (09:49 +0300)]
LU-15830 mdt: mkdir to lookup target name

distributed mkdir should lookup the target name to
avoid rollback as much as possible as the latter is
very expensive due to llog re-initialization.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: If28760e0afb804dca11e1e7501e0a53ff9067ca1
Reviewed-on: https://review.whamcloud.com/47226
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15757 llite: check s_root ll_md_blocking_ast() 86/47086/2
Alex Zhuravlev [Tue, 19 Apr 2022 12:01:14 +0000 (15:01 +0300)]
LU-15757 llite: check s_root ll_md_blocking_ast()

ll_md_blocking_ast() can be called in the context of import
invalidation which in turn caused by umount. this way
ll_md_blocking_ast() and umount can race and ll_md_blocking_ast()
can found sb->s_root NULL which should be checked before
calling into is_root_inode().

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I61c1d29a7de3084ad1dfd0c216cee628418b7038
Reviewed-on: https://review.whamcloud.com/47086
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>
Tested-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15827 osd: respect filldir buffer limits 24/47224/3
John L. Hammond [Thu, 5 May 2022 19:21:37 +0000 (14:21 -0500)]
LU-15827 osd: respect filldir buffer limits

In osd_ldiskfs_filldir() ensure that the encoded name also fits in the
buffer. In osd_ldiskfs_filldir() and obj_name2lu_name() remove a
superfluous and potentially incorrect check on names that appear to be
FIDs.

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I1540f058801b002474ceac1206317344cebb1084
Reviewed-on: https://review.whamcloud.com/47224
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoRevert "LU-12019 build: Recognize Debian Kernel and set KMP dir" 38/47238/2
Minh Diep [Fri, 6 May 2022 17:14:19 +0000 (10:14 -0700)]
Revert "LU-12019 build: Recognize Debian Kernel and set KMP dir"

This reverts commit 230d4500d5a9dfada392199d77fc413382f24750.

Revert this commit because lustre failed to load on MOFED 5.5
See LU-15831 for details

Change-Id: I845431ad2126743c1ca9a59d1b56e1a35dbc9e38
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47238
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15810 sec: fix enc dir migration 01/47201/3
Sebastien Buisson [Tue, 3 May 2022 15:30:18 +0000 (17:30 +0200)]
LU-15810 sec: fix enc dir migration

Now that the encryption context is stored in an xattr named
"encryption.c" instead of "security.c", we need to fetch this xattr
explicitly in case of encrypted directory migration. Indeed, there is
no xattr handler in ldiskfs for this "encryption." xattr type, so it
is not returned when listing all xattrs to migrate.

Fixes: 4231fab66e ("LU-13717 sec: make client encryption compatible with ext4")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I628f9b253e86343db0b71f6a5b1ad2c5728ca38d
Reviewed-on: https://review.whamcloud.com/47201
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoPost-branch-off of 2.15 master is now 2.16 2.15.50 v2_15_50
Oleg Drokin [Fri, 6 May 2022 19:13:11 +0000 (15:13 -0400)]
Post-branch-off of 2.15 master is now 2.16

Change-Id: I93ff129b038dff4f541ca9497ba21b77eaf82de8
Signed-off-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15787 sec: document enc-unaware clients on enc files 82/47182/2
Sebastien Buisson [Mon, 2 May 2022 13:36:00 +0000 (15:36 +0200)]
LU-15787 sec: document enc-unaware clients on enc files

Document the behavior of encryption-unaware clients when they access
encrypted files.

Test-Parameters: trivial
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I0354e3051e10aa0542baeb8e34c6201d47e65710
Reviewed-on: https://review.whamcloud.com/47182
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
23 months agoNew RC 2.15.0-RC4 2.15.0-RC4 v2_15_0-RC4
Oleg Drokin [Thu, 5 May 2022 18:52:44 +0000 (14:52 -0400)]
New RC 2.15.0-RC4

Change-Id: Iabd55b89a5551e5f42f7f6b112c7a7187da8ae7b
Signed-off-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15815 llite: disable fast_read and workaround 04/47204/3
John L. Hammond [Tue, 3 May 2022 19:25:36 +0000 (14:25 -0500)]
LU-15815 llite: disable fast_read and workaround

Revert the fast_read stale data workaround from LU-14541 and disable
fast_read by default. The workaround causes applications to receive
spurious SIGBUGs when reclaim is concurrent with mmap page fault
handlers. We disable fast read to avoid the stale data issue entirely.

This reverts commit f2a16793fa4316fc9ccdc46bcfe54f6b8d1e442b and
re-exposes us to the consistency issues described in LU-14541.

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I716b1fd6ab22242b9267b8883f0371a360aaecef
Reviewed-on: https://review.whamcloud.com/47204
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15761 obdclass: fix locking in llog_cat_refresh() 85/47185/3
Alex Zhuravlev [Mon, 2 May 2022 18:38:47 +0000 (21:38 +0300)]
LU-15761 obdclass: fix locking in llog_cat_refresh()

the patch fixes two problems:
1) pairing up_write() should be used with cathandle
2) llog_read_header() manipulates loghandle's internal
   structures (header, last_idx, etc) which are supposed
   to stay consistent from another user's point of view
   (like llog_add_rec())

Fixes: 71f409c9b31b ("LU-11418 llog: refresh remote llog upon -ESTALE")
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ib86e10a925b541d02c22d74e6ddbc4368345ac11
Reviewed-on: https://review.whamcloud.com/47185
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15803 sec: correctly handle page lock in ll_io_zero_page 70/47170/5
Sebastien Buisson [Thu, 28 Apr 2022 13:34:57 +0000 (15:34 +0200)]
LU-15803 sec: correctly handle page lock in ll_io_zero_page

In ll_io_zero_page(), we need to make sure we have locked the page,
and it is up-to-date, before zeroing. So modify ll_io_read_page()
behavior to not disown the clpage for our use case. It avoids being
exposed to concurrent modifications.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I58e4cf80374a798c9c4302364cf2fb39da9033bb
Reviewed-on: https://review.whamcloud.com/47170
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15787 sec: block enc unaware clients on enc files 56/47156/5
Sebastien Buisson [Wed, 27 Apr 2022 15:33:57 +0000 (17:33 +0200)]
LU-15787 sec: block enc unaware clients on enc files

Prevent encryption unaware clients from manipulating encrypted files
and directories. Those can be old clients, or clients built without
encryption support (intentionally or because they run on an old
kernel).
In the mdt layer, check that clients have the OBD_CONNECT2_ENCRYPT
connection flag, and if not, block access if they try to manipulate
a file or directory that has the LUSTRE_ENCRYPT_FL flag.
The forbidden operations from encryption unaware clients are:
- open
- create
- link
- rename
- migrate
Improve sanity-sec test_54 to test this use case.

Test-Parameters: testlist=sanity-sec mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 serverdistro=el7.9
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Ief0639e49c0a8e1a1a0cb19cb13c006edfdff6c4
Reviewed-on: https://review.whamcloud.com/47156
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15479 tests: clean up sanity test_316/test_319 59/46959/3
Andreas Dilger [Wed, 30 Mar 2022 18:30:13 +0000 (12:30 -0600)]
LU-15479 tests: clean up sanity test_316/test_319

These tests use the deprecated "lfs mv" insted of "lfs migrate".

Fix test_316 to specify which MDT to create 'd' on, so MDT space
balancing does not result in 'd' being created on MDT0001, which
defeats the purpose of the test trying to migrate it to MDT0001.

Fix test_319 to call "lfs migrate" on the parent directory and
not on the test file, since this returns an "ENOTDIR" error.

Also fix some minor script style issues.

Test-Parameters: trivial testlist=sanity env=ONLY="316 319",ONLY_REPEAT=100 mdscount=2 mdtcount=4
Test-Parameters: fstype=zfs testlist=sanity env=ONLY="316 319",ONLY_REPEAT=100 mdscount=2 mdtcount=4
Fixes: ae7ca90713b4 ("LU-11926 ldlm: Lost lease lock on migrate error")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I08d55ce70cbd900c2f4d31b27baa1a33423ebbe5
Reviewed-on: https://review.whamcloud.com/46959
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15740 tests: add more stats to runtests 65/47065/3
Andreas Dilger [Wed, 13 Apr 2022 20:18:32 +0000 (14:18 -0600)]
LU-15740 tests: add more stats to runtests

Print out the space usage at the start, middle, and end of
runtests, so that it is easier to see where the space is
going, and how much is used at peak consumption.  The goal
of the test is to avoid space leakage in object create and
destroy, but it is OK if there is some usage for internal
files like llogs, quotas, etc.

Move the "mkdirmany" call to the first phase, add a statmany
to the middle phase, and "rmdirmany" to the end so that it
is also checking the directory validity after a remount.

Update createmany and statmany to be a bit easier to use.

Test-Parameters: trivial testlist=runtests env=SLOW=yes mdscount=2 mdtcount=4
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iec8cb56501c7e75b620951a2d669b0dd6bb0a36f
Reviewed-on: https://review.whamcloud.com/47065
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: cliff white <cwhite@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15575 tests: interop skip sanity/103e before 2.14.52 25/47125/2
Andreas Dilger [Wed, 20 Apr 2022 19:13:42 +0000 (13:13 -0600)]
LU-15575 tests: interop skip sanity/103e before 2.14.52

Older MDSes can *set* default ACLs with many entries, but it
causes an error when trying to *create* files that inherit them.
Skip test_103e for older MDS versions.

Test-Parameters: trivial testlist=sanity env=ONLY=103e serverversion=2.14.0
Fixes: aa92caa21fa2 ("LU-14430 mdt: fix maximum ACL handling")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I4fbed3f788020c6d158ba83496ebd5cd68ba57cb
Reviewed-on: https://review.whamcloud.com/47125
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15358 tests: fix check in sanityn test_80b 06/46706/5
Andreas Dilger [Fri, 4 Mar 2022 19:04:10 +0000 (12:04 -0700)]
LU-15358 tests: fix check in sanityn test_80b

Shellcheck found checks in sanityn test_80b using bad logic:

        [ $rc -ne 0 -o $rc -ne 16 ] || {
                echo "touch file failed with $rc1"
                break;
        }

This can never be false, so the subtest will never detect errors.
Fix these checks, along with some related style issues.

Test-Parameters: trivial testlist=sanityn mdscount=2 mdtcount=4 env=ONLY=80,ONLY_REPEAT=50
Fixes: 220e6cbfa65c5 ("LU-6475 mdt: race between open and migrate")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I541fe6f3ae253ea1c4d7fa2bcfad9052e374e60c
Reviewed-on: https://review.whamcloud.com/46706
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-14826 tests: fix sanityn.sh test_102 version check 93/46693/3
Andreas Dilger [Thu, 3 Mar 2022 18:41:58 +0000 (11:41 -0700)]
LU-14826 tests: fix sanityn.sh test_102 version check

The MDS version check in test_102 had a syntax error, found
by 'shellcheck'.

Also quiet spurios error messages from check_fhandle_syscalls
if the "lctl" binary cannot be found.

Fixes: cbc62b0b829 ("LU-14826 mdt: getattr_name("..") under striped directory")
Test-Parameters: trivial testlist=sanityn mdscount=2 mdtcount=4 env=ONLY=102,ONLY_REPEAT=100
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iee432bc147f63809fea095c4ce9e1694f7ce7057
Reviewed-on: https://review.whamcloud.com/46693
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
23 months agoLU-15645 obdclass: llog to handle gaps 37/46837/9
Alex Zhuravlev [Wed, 16 Mar 2022 09:10:38 +0000 (12:10 +0300)]
LU-15645 obdclass: llog to handle gaps

due to old errors an update llog can contaain gaps in index.
this shouldn't block llog processing and recovery. actual
gaps in transaction sequence should be catched by VBR.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I11ec817e356f9658118c34706ef3a533e7faba83
Reviewed-on: https://review.whamcloud.com/46837
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>
23 months agoLU-15748 osc: fallocate interop for 2.14 clients 98/47098/4
Arshad Hussain [Wed, 20 Apr 2022 09:07:53 +0000 (05:07 -0400)]
LU-15748 osc: fallocate interop for 2.14 clients

fallocate() start and end are passed in o_size and o_blocks
on the wire.  Clients 2.15.0 and newer should always set
the OBD_MD_FLSIZE and OBD_MD_FLBLOCKS valid flags, but some
older client versions did not.  We permit older clients to
not set these flags, checking their version by proxy using
the missing OBD_CONNECT_TRUNCLOCK to imply 2.14.0 or older.

Test-Parameters: serverversion=2.14.0 testlist=sanity env=SANITY_EXCEPT="64h 103e"
Fixes: 2f496148c31d ("LU-15551 Return EOPNOTSUPP instead of EPROTO")
Fixes: 163870abfb7c ("LU-14382 mdt: implement fallocate in MDC/MDT")
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I1ea47854f40d54297bceb03ad32b24737efa4ae7
Reviewed-on: https://review.whamcloud.com/47098
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
23 months agoLU-15719 doc: Update changelog to properly reflect supported kernels 93/46993/3
Oleg Drokin [Tue, 5 Apr 2022 16:37:32 +0000 (12:37 -0400)]
LU-15719 doc: Update changelog to properly reflect supported kernels

According to https://wiki.lustre.org/Release_2.15.0

Also update e2fsprogs version from the same document

Change-Id: Ife26db67b543bb83651b56df41beaf81fea97721
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46993
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Peter Jones <pjones@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
2 years agoNew RC 2.15.0-RC3 2.15.0-RC3 v2_15_0-RC3
Oleg Drokin [Sun, 3 Apr 2022 16:09:39 +0000 (12:09 -0400)]
New RC 2.15.0-RC3

Change-Id: If8b76076bedd13b39dac94ab582e1855feb6add4
Signed-off-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15670 clio: Disable lockless for DIO with O_APPEND 90/46890/4
Shaun Tancheff [Tue, 22 Mar 2022 13:08:35 +0000 (08:08 -0500)]
LU-15670 clio: Disable lockless for DIO with O_APPEND

Lockless O_DIRECT with O_APPEND can allow interleaved / racy
appends from concurrent I/O.

Disable lockless I/O when O_APPEND is set

HPE-bug-id: LUS-9776
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I5c56f92c90e631c295f56e5958985f516e1990f8
Reviewed-on: https://review.whamcloud.com/46890
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15616 lnet: ln_api_mutex deadlocks 27/46727/7
Chris Horn [Mon, 7 Mar 2022 17:03:50 +0000 (11:03 -0600)]
LU-15616 lnet: ln_api_mutex deadlocks

LNetNIFini() acquires the ln_api_mutex and holds onto it throughout
various shutdown routines. Meanwhile, LND threads (via
lnet_nid2peerni_locked()) or the discovery thread (via
lnet_peer_data_present()) may need to acquire this mutex in order to
progress.

Address these potential deadlocks by setting the_lnet.ln_state to
LNET_STATE_STOPPING earlier in LNetNIFini(), and release the mutex
prior to any call into LND module or before any wait.

LNetNIInit() is modified to return -ESHUTDOWN if it finds that there
is a concurrent shutdown in progress.

HPE-bug-id: LUS-10681
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: Ia8b28cc95ff71e66a0f99aed4f2c22ec9d44ce1e
Reviewed-on: https://review.whamcloud.com/46727
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-13714 lnet: only update gateway NI status on discovery 76/39176/6
Chris Horn [Mon, 14 Feb 2022 20:37:05 +0000 (20:37 +0000)]
LU-13714 lnet: only update gateway NI status on discovery

Move the NI status from DOWN to UP only when receiving
a discovery PING. The discovery PING should be the only
message which should update the NI status since it's used
as the gateway NI keep alive mechanism.

This is done to avoid the following scenario:

The gateway itself can push its updates to the peers which
have removed it from its routing table. The peers would
respond to the PUSH with an ACK, the ACK will bring the
gateway's NI status to up. Therefore other peers which have
avoid_asym_router_failure=1 will have their route status
remain up even though the symmetrical route is gone.

Note: there is no way for the gateway to differentiate between
a keep alive discovery and a manually triggered discovery or ping.
However, this a narrow case which will not be handled.

net_last_alive converted to use ktime_get_seconds() instead of
ktime_get_real_seconds() since the NTP adjustment is not needed.

Test-Parameters: trivial
Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: Ifd5b06d4cf783b68b36413ada63f0a1d0095fb5b
Reviewed-on: https://review.whamcloud.com/39176
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15363 tests: don't use lustre module to test lnet 34/45834/6
James Simmons [Wed, 30 Mar 2022 13:10:28 +0000 (09:10 -0400)]
LU-15363 tests: don't use lustre module to test lnet

Currently sanity-lnet.sh loads the lustre modules to properly
initialize the lnet modules. This doesn't work with the native
Linux client since it only starts up LNet after mounting the
file system. We shouldn't be using lustre to test lnet so
load lnet modules with config_on_load option to properly setup
the default LNet configuration.

Also fix ksocklnd-config to use bash so sanity-lnet.sh can
pass on Ubuntu.

Test-Parameters: trivial testlist=sanity-lnet
Change-Id: Ifffc51625f5c2ffbb3ab811b75739c0e6407a821
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/45834
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>
2 years agoLU-15545 utils: fix double free in lgss_sk 94/46594/2
Lei Feng [Wed, 23 Feb 2022 10:07:53 +0000 (18:07 +0800)]
LU-15545 utils: fix double free in lgss_sk

Fix double free issue in lgss_sk if write_config_file fails.

Signed-off-by: Lei Feng <flei@whamcloud.com>
Test-Parameters: trivial
Change-Id: Icd1673b27d699fba78b01fe53f587291e6c36ed6
Reviewed-on: https://review.whamcloud.com/46594
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: Sebastien Buisson <sbuisson@ddn.com>
2 years agoLU-15692 lmv: change default hash back to fnv_1a_64 50/46950/2
Andreas Dilger [Wed, 30 Mar 2022 04:04:45 +0000 (22:04 -0600)]
LU-15692 lmv: change default hash back to fnv_1a_64

Until performance issue is resolved, change the default directory
hash type from 'crush' back to 'fnv_1a_64'.

Fixes: bb60caa1c6e7 ("LU-14459 lmv: change default hash type to crush")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: If2cef70298773f42dc1c62809eea98519b3ebbe5
Reviewed-on: https://review.whamcloud.com/46950
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Shuichi Ihara <sihara@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15702 lov: remove lo_trunc_stripeno 40/46940/2
John L. Hammond [Mon, 28 Mar 2022 17:24:54 +0000 (12:24 -0500)]
LU-15702 lov: remove lo_trunc_stripeno

Remove the lo_trunc_stripeno member of struct lov_layout_raid0 and add
an lis_trunc_stripe_index array to struct lov_io. This makes the
truncate stripe index information belong to the IO and not to the
concurrently accessed object. This is needed because we do not have
locking that protects it from its initialization in lov_io_iter_init()
to its use in lov_lock_sub_init(). Also remove the unused
lo_write_lock member of struct lov_object.

Fixes: 9801500451 ("LU-14128 lov: correctly set OST obj size")
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I799e07059212629fe9d84c5e58c349035a40da9e
Reviewed-on: https://review.whamcloud.com/46940
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for sanity.sh 41/46741/8
Arshad Hussain [Tue, 8 Mar 2022 15:08:18 +0000 (20:38 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for sanity.sh

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/sanity.sh

Test-Parameters: trivial testlist=sanity
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I4223aff8bf740ba5710f58fae697768f3f704591
Reviewed-on: https://review.whamcloud.com/46741
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for sanity-lnet 24/46824/2
Arshad Hussain [Tue, 15 Mar 2022 09:07:12 +0000 (14:37 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for sanity-lnet

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/sanity-lnet.sh

Test-Parameters: trivial testlist=sanity-lnet
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I55777e6b65a40c90225c40c29e16fbeb44c3411b
Reviewed-on: https://review.whamcloud.com/46824
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for sanity-flr.sh 97/46797/3
Arshad Hussain [Wed, 9 Mar 2022 08:31:24 +0000 (14:01 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for sanity-flr.sh

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/sanity-flr.sh

Test-Parameters: trivial testlist=sanity-flr
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I5ce498f9b373650885351ea105121139eb4ed35c
Reviewed-on: https://review.whamcloud.com/46797
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>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for recovery-small 41/46841/2
Arshad Hussain [Wed, 16 Mar 2022 12:01:36 +0000 (17:31 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for recovery-small

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/recovery-small.sh. This patch also
moves spaces to tabs.

Test-Parameters: trivial testlist=recovery-small
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I2db37f0579770ab5a51baf5db832d1f316e7cb14
Reviewed-on: https://review.whamcloud.com/46841
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>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for setup-kerberos 22/46822/2
Arshad Hussain [Tue, 15 Mar 2022 08:28:23 +0000 (13:58 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for setup-kerberos

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/setup_kerberos.sh. This patch also
moves spaces to tabs.

Change-Id: I803c35b5fc0470a9eeb9ef3c230a0a01adc5b16c
Test-Parameters: envdefinitions=SHARED_KEY=true testlist=sanity
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-on: https://review.whamcloud.com/46822
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for sanity-hsm 98/46798/2
Arshad Hussain [Thu, 10 Mar 2022 07:19:28 +0000 (12:49 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for sanity-hsm

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/sanity-hsm

Test-Parameters: trivial testlist=sanity-hsm
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I14b12affb9ec8b8c943569cedf103d8d5c8ec207
Reviewed-on: https://review.whamcloud.com/46798
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>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for conf-sanity 23/46823/3
Arshad Hussain [Tue, 15 Mar 2022 06:19:06 +0000 (11:49 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for conf-sanity

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/conf-sanity.sh. This patch also
moves spaces to tabs.

Test-Parameters: trivial testlist=conf-sanity
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I381af41adb5267e2fd879d4f8ef2c3ccdc10cdae
Reviewed-on: https://review.whamcloud.com/46823
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>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for recovery-double-scale 25/46825/5
Arshad Hussain [Tue, 15 Mar 2022 10:19:35 +0000 (15:49 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for recovery-double-scale

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/recovery-double-scale. This patch
also moves spaces to tabs.

Test-Parameters: trivial clientcount=6 mdtcount=2 mdscount=2 osscount=2 austeroptions=-R failover=true iscsi=1 env=FAILOVER_PERIOD=180 testlist=recovery-double-scale env=SLOW=yes
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: Iddb505f717bc87dd314d7bd988ba5db2271d8125
Reviewed-on: https://review.whamcloud.com/46825
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>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for sanity-dom 96/46796/2
Arshad Hussain [Wed, 9 Mar 2022 07:27:25 +0000 (12:57 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for sanity-dom

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/sanity-dom.sh

Test-Parameters: trivial testlist=sanity-dom
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I185622dcb30abbc43a2118cbfaa9c643f8ce52bc
Reviewed-on: https://review.whamcloud.com/46796
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>
2 years agoLU-15626 tests: Fix "error" reported by shellcheck for sanity-lfsck 95/46795/2
Arshad Hussain [Fri, 11 Mar 2022 05:46:19 +0000 (11:16 +0530)]
LU-15626 tests: Fix "error" reported by shellcheck for sanity-lfsck

This patch fixes "error" issues reported by shellcheck
for file lustre/tests/sanity-lfsck

Test-Parameters: trivial testlist=sanity-lfsck
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I3f85cb04f93125ed132831c14a8a3f3616c99a0d
Reviewed-on: https://review.whamcloud.com/46795
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>
2 years agoLU-15614 tests: Variable incorrectly used in sanity-flr/203 90/46690/2
Arshad Hussain [Thu, 3 Mar 2022 08:50:52 +0000 (14:20 +0530)]
LU-15614 tests: Variable incorrectly used in sanity-flr/203

Under sanity-flr.sh/203 variable 'old_id' and
'new_id' is defined incorrectly as 'oldid' and
'newid'. This was exposed using shellcheck.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In lustre/tests/sanity-flr.sh line 3258:
[[ x$oldid = x$newid ]] ||
^-- SC2154: oldid is referenced but not assigned (did you mean 'old_id'?).
^-- SC2154: newid is referenced but not assigned (did you mean 'new_id'?).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Test-Parameters: trivial testlist=sanity-flr
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I37949035f50dfdd33e5181ad888f68fcb204c385
Reviewed-on: https://review.whamcloud.com/46690
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
2 years agoLU-15612 tests: Replace unicode double quotes 87/46687/3
Arshad Hussain [Thu, 3 Mar 2022 04:02:54 +0000 (09:32 +0530)]
LU-15612 tests: Replace unicode double quotes

Under conf-sanity.sh replace unicode double
quotes with ASCII. This was exposed using
shellcheck.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In lustre/tests/conf-sanity.sh line 335:
umount_client $MOUNT -f || error ...
^-- SC1015: This is a unicode double quote. Delete and retype it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Test-Parameters: trivial testlist=conf-sanity
Change-Id: I89e510a1d16059079378fc9399c1377017870477
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-on: https://review.whamcloud.com/46687
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>
2 years agoLU-15548 osd-ldiskfs: hide virtual projid xattr 00/46900/3
Li Dongyang [Wed, 23 Mar 2022 09:42:51 +0000 (20:42 +1100)]
LU-15548 osd-ldiskfs: hide virtual projid xattr

Add tunable enable_projid_xattr to hide the virtual
project ID xattr by default.

Change-Id: I21263d91599f9e2d5850cb9d94a8b6df90c8443c
Test-Parameters: trivial testlist=conf-sanity env=ONLY=131
Test-Parameters: testlist=sanity env=ONLY=904
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/46900
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15637 llite: Fix use of uninitialized fields 76/46776/3
Patrick Farrell [Thu, 10 Mar 2022 03:16:50 +0000 (22:16 -0500)]
LU-15637 llite: Fix use of uninitialized fields

We use data from ci_rw to set io_start_index and
io_end_index, which is a problem for mmap because mmap does
not use ci_rw.

When ci_rand_read is set or readahead is disabled, we use
these values to decide how much data to read.

ci_rw is uninitialized, and if the values are non-zero,
we may try to read data beyond the locks we took for our
I/O.

If there is no lock (either because there was never one or
it was cancelled), this results in an LBUG in
osc_req_attr_set when it verifies the pages are covered by
a lock.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: If7c8d2eb87a28bf76a6f959e7be7bf636c887cfe
Reviewed-on: https://review.whamcloud.com/46776
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: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15435 ptlrpc: unregister reply buffer on rq_err 32/46132/11
Alexander Zarochentsev [Fri, 14 Jan 2022 15:35:48 +0000 (10:35 -0500)]
LU-15435 ptlrpc: unregister reply buffer on rq_err

Unregister reply buffer on rq_err and prevent a late reply from
modifying request flags in INTERPRET state.

Fixes: cefabee52586 ("LU-15112 mgc: do not ignore target registration failure")
HPE-bug-id: LUS-10717

Signed-off-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Change-Id: I0106e3fd5443c1292c103247cdbf6122f91922e8
Reviewed-on: https://review.whamcloud.com/46132
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15571 tests: save/restore debug mask for interop 36/46636/5
Andreas Dilger [Sat, 26 Feb 2022 03:17:21 +0000 (20:17 -0700)]
LU-15571 tests: save/restore debug mask for interop

The "createmany" and "unlinkmany" wrappers were saving the debug
mask on the client and restoring it on the server, which fails in
interop testing if the client has a debug mask set that is unknown
on the server.

Use the debugsave() and debugrestore() helpers to do this properly.

Fixes: 40d286e11138 ("LU-15317 llite: Add D_IOTRACE")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I36fc06d5a62e34d63619fa977d9f80254bbc073e
Reviewed-on: https://review.whamcloud.com/46636
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15661 nodemap: fix map mode value for 'both' 70/46870/2
Sebastien Buisson [Fri, 18 Mar 2022 16:43:31 +0000 (01:43 +0900)]
LU-15661 nodemap: fix map mode value for 'both'

The patch that introduced the ability to map project IDs with
nodemap changed the value used for the "map both uid and gid"
case, from 0 to 3.
This poses a problem in case of upgrade from a previous Lustre
version, so re-introduce the value 0 as NODEMAP_MAP_BOTH_LEGACY.

Change-Id: I1f605de9c97faff32411da5052e8782a60645767
Fixes: 8a770616a5 ("LU-14797 sec: add projid to nodemap")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-on: https://review.whamcloud.com/46870
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15551 ofd: Return EOPNOTSUPP instead of EPROTO 16/46516/13
Arshad Hussain [Mon, 14 Feb 2022 10:02:08 +0000 (15:32 +0530)]
LU-15551 ofd: Return EOPNOTSUPP instead of EPROTO

Modify server to return -EOPNOTSUPP instead of
-EPROTO for unsupported fallocate modes

Test-Parameters: serverversion=2.14.0 testlist=sanity env=ONLY=150
Test-Parameters: serverversion=2.14.0 testlist=sanity-flr env=ONLY=50
Test-Parameters: serverversion=2.14.0 testlist=ost-pools env=ONLY="29 31"
Test-Parameters: serverversion=2.14.0 testlist=sanity-benchmark env=ONLY=fsx
Test-Parameters: serverversion=2.14.0 testlist=sanity-dom env=ONLY=fsx
Test-Parameters: serverversion=2.14.0 testlist=sanityn env=ONLY=16
Fixes: 7462e8cad730 ("LU-14160 fallocate: Add punch mode to fallocate")
Signed-off-by: arshad.hussain@aeoncomputing.com
Change-Id: Id203c0b9abbdd674af33f1f78e81ae7fe105e90f
Reviewed-on: https://review.whamcloud.com/46516
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15634 ptlrpc: Use after free of 'conn' in rhashtable retry 63/46763/2
Shaun Tancheff [Wed, 9 Mar 2022 08:53:24 +0000 (02:53 -0600)]
LU-15634 ptlrpc: Use after free of 'conn' in rhashtable retry

Use after free of 'conn' in the uncommon case of
rhashtable_lookup_get_insert_fast failing with -EBUSY or -ENOMEM

Move OBD_FREE_PTR(conn) below the retry and set conn2 to NULL
on error, propagating to conn and returning to the caller.

HPE-bug-id: LUS-10776
Fixes: 37b29a8f70 ("LU-8130 ptlrpc: convert conn_hash to rhashtable");
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I2fb27d4e8fa6a5324d0a8e06afe34a39fa622bc2
Reviewed-on: https://review.whamcloud.com/46763
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>
2 years agoLU-15506 tests: fix sha1sum error for disk images with multiple mdts 04/46404/5
Andreas Dilger [Tue, 1 Feb 2022 10:20:53 +0000 (03:20 -0700)]
LU-15506 tests: fix sha1sum error for disk images with multiple mdts

For new disk2_10-ldiskfs and disk2_12-ldiskfs images,
check remote_dir for sha1sum test. For dne image, check
striped_dir.

One minor ost2 replace_nids fix for DNE test images.

Add verbose debug messages to make test flow more clear.

Test-Parameters: trivial testlist=conf-sanity env=ONLY=32 mdscount=1 mdtcount=1
Test-Parameters: testlist=conf-sanity env=ONLY=32 mdscount=2 mdtcount=4
Fixes: f2143c0790bb ("LU-11643 tests: add new images and tests for upgrade")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Wei Liu <sarah@whamcloud.com>
Change-Id: I582bcdbf72d72e6da636559a24b1ecc89553c895
Reviewed-on: https://review.whamcloud.com/46404
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15546 mdt: mdt_reint_open lookup before locking 79/46679/4
Etienne AUJAMES [Wed, 2 Mar 2022 17:58:20 +0000 (18:58 +0100)]
LU-15546 mdt: mdt_reint_open lookup before locking

This patch is an optimization of 33dc40d ("LU-10262 mdt:
mdt_reint_open: check EEXIST without lock").

The current behavior is to take a LCK_PR on parent to verify if the
file exist and then take a LCK_PW to create the file.

Here we do a lookup to determine the mode before tacking a lock.
This avoid to re-lock each time for create cases.

Most of the time we have:
1. lookup the child in parent directory
2. take the parent lock: file_exist ? LCK_PR : LCK_PW
3. re-lookup the child

In a race senario (create/unlink) we have:
1. lookup child in parent directory -> file exists
2. take a LCK_PR on the parent
3. re-lookup the child -> file doesn't exist
2. take a LCK_PW on the parent
4. re-lookup the child

This patch fix the "SKIP" condition for sanityn 41i/43k/45j and clear
the LRU locks cache for sanityn 43k/45j.

Fixes: 33dc40d ("LU-10262 mdt: mdt_reint_open: check EEXIST without lock")
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I121abd4babfb516d7a64682b054a6443d38590ef
Reviewed-on: https://review.whamcloud.com/46679
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15608 sec: fix DIO for encrypted files 64/46664/6
Sebastien Buisson [Tue, 1 Mar 2022 16:26:09 +0000 (17:26 +0100)]
LU-15608 sec: fix DIO for encrypted files

With Direct IO, we do not have proper page cache pages. So we need to
retrieve by ourselves the page mapping and the page index of the page
to be encrypted/decrypted.

For the index, we need to use the offset of the page within the file,
and not the object.
So we rename cl_page's cp_osc_index to cp_page_index for that purpose.
cp_osc_index is redundant with osc_async_page's oap_obj_off and only
used by osc_index(), so we also adapt this function.
cp_page_index is initialized in cl_page_alloc(), and accessed in
the OSC layer where the llcrypt primitives are called.

For the mapping, problem is page->mapping is not set to NULL on page
allocation, so it cannot safely be used to see if a page is a direct
I/O page.
Use cl_page for direct I/O and page->mapping for buffered
I/O.  (clpage->cp_inode is only set for direct I/O and
cannot easily be always set.)
Without this, we sometimes get panics when page2inode is
used in the OSC layer.  (Note the remaining use in dom is
safe because ll_dom_readpage is a page cache helper and
will never see DIO pages.)

Fixes: a71e0dd7f7 ("LU-14306 sec: get rid of bad rss-counter state messages")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Icb53a4e45463b8d3febc2e6212b39dc25719d866
Reviewed-on: https://review.whamcloud.com/46664
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15021 quota: protect lqe_glbl_data in lqe 98/45098/9
Hongchao Zhang [Wed, 13 Oct 2021 09:02:23 +0000 (17:02 +0800)]
LU-15021 quota: protect lqe_glbl_data in lqe

The lqe_glbl_data in "struct lquota_entry" is allocated in
qmt_lvbo_init and freed in qmt_lvbo_free, it could be freed
during qmt_seed_glbe called by qmt_set_id_notify, and cause
panic because of using freed memory.

Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Change-Id: I274f07ee8609c83852572be51625cc929a9130ec
Reviewed-on: https://review.whamcloud.com/45098
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
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>
2 years agoLU-15589 tests: skip sanity test_230s for interop 98/46598/2
Andreas Dilger [Wed, 23 Feb 2022 19:24:12 +0000 (12:24 -0700)]
LU-15589 tests: skip sanity test_230s for interop

Sanity test_230s was added in 2.14.52 but incorrectly checked for
MDS version 2.13.57 for interop, likely because that was the version
present at the time the patch was originally written, but it was
only landed later.

Test-Parameters: trivial serverversion=2.14.0 testlist=sanity env=ONLY=230s
Fixes: 65e3e4050ec5 ("LU-14366 mdt: lfs mkdir should return -EEXIST if exists")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I5d046ad224a29558866453972c9c33b5da3a9037
Reviewed-on: https://review.whamcloud.com/46598
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Alena Nikitenko <anikitenko@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15467 tests: fix sanity-hsm test_103a timeout issue 52/46252/2
Etienne AUJAMES [Fri, 21 Jan 2022 14:49:18 +0000 (15:49 +0100)]
LU-15467 tests: fix sanity-hsm test_103a timeout issue

Add check mds version in "sanity-hsm test_103a" for interop test.
Limit the number of parralel hsm restore requests to
max_rpcs_in_flight.

Fixes: b449f3d ("LU-15145 hsm: unlock the restore layout lock for a cancel")
Test-Parameters: trivial
Test-Parameters: testlist=sanity-hsm env=ONLY=103a,ONLY_REPEAT=20
Test-Parameters: testlist=sanity-hsm
Signed-off-by: Etienne AUJAMES <etienne.aujames@cea.fr>
Change-Id: I78098042d1316cdcc9d2e25860099a0ffdba2503
Reviewed-on: https://review.whamcloud.com/46252
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alena Nikitenko <anikitenko@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15576 osp: Interop skip sanity test 823 for MDS < 2.14.56 67/46567/4
Shaun Tancheff [Tue, 22 Feb 2022 07:28:50 +0000 (01:28 -0600)]
LU-15576 osp: Interop skip sanity test 823 for MDS < 2.14.56

Prior to v2_14_55-29-g06e586016d setting create_count greater
than the maximum returned -ERANGE.

During interop testing skip sanity/823 for MDS older than 2.14.56.

Test-Parameters: trivial serverversion=2.14.0 testlist=sanity env=ONLY=823
Fixes: 06e586016d3a ("LU-13941 osp: Silently lower requested create_count to maximum")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Ie79617deea047b2a846f696473b9c2b5681953be
Reviewed-on: https://review.whamcloud.com/46567
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Tested-by: Maloo <maloo@whamcloud.com>
2 years agoLU-15601 osd-ldiskfs: handle read_inode_bitmap() error 60/46660/3
Andreas Dilger [Tue, 1 Mar 2022 05:14:37 +0000 (22:14 -0700)]
LU-15601 osd-ldiskfs: handle read_inode_bitmap() error

Correctly handle a PTR_ERR() error return from read_inode_bitmap().
This changed in upstream kernel commit v4.3-rc2-17-g9008a58e5dce,
so handle this for both types of return value.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I184c09b300ed69c29e4a7ef343f473b67080381f
Reviewed-on: https://review.whamcloud.com/46660
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15513 lod: skip uninit component in lod_fill_mirrors 35/46435/5
Andreas Dilger [Wed, 2 Feb 2022 22:05:18 +0000 (15:05 -0700)]
LU-15513 lod: skip uninit component in lod_fill_mirrors

Do not iterate over the "objects" in lod_fill_mirrors() to check
for non-rotational OSTs if the component is uninitialized.  In
cases where an OST is not present (e.g. sparse OST indexes used)
the lod_tgt_desc[] array has holes and OST_TGT() returns NULL.

Skip the loop entirely if the component is not initialized, but
also add some sanity checks to verify that the OST index values
are sane in case there are other problems in the future (e.g.
corrupt/invalid layout on disk).

Fixes: 8507472dd37e ("LU-14996 lov: prefer mirrors on non-rotational OSTs")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I8ec23367059a4ec9e483adb768095b24f03ebbe5
Reviewed-on: https://review.whamcloud.com/46435
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
2 years agoLU-15316 tests: use integers in sanity test_255a 50/46350/2
Andreas Dilger [Fri, 28 Jan 2022 05:51:24 +0000 (22:51 -0700)]
LU-15316 tests: use integers in sanity test_255a

The [[ ... > ... ]] operator doesn't really compare floats, it
compares strings.  That works as expected if the strings are
the same length, but fails for comparisons like [[ 32 > 123 ]].
Use (( ... > ... )) for comparisons, and only use integer values.

This test has been failing intermittently forever, but the error
was ignored because of running in a VM.

Test-Parameters: trivial
Fixes: f3b8f3fad502 ("tests: fix float comparison in sanity test_255a")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I6787082cd579ae3f1bdd43222a739c939d3ebbe5
Reviewed-on: https://review.whamcloud.com/46350
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Elena Gryaznova <elena.gryaznova@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>