LU-15784 obdecho: don't panic with run on second mdt obdecho should correctly return errors in error situations: 1. connected to devices other than mdd due structure differences. 2. run an operations against of remote objects. HPe-bug-id: LUS-10913 Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com> Change-Id: I11c524f205533287a9b5724419741dfbad508d29 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/47147 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-6142 obdclass: Fix style issues for lu_object.c This patch fixes issues reported by checkpatch for file lustre/obdclass/lu_object.c Test-Parameters: trivial Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Change-Id: I4dea184d749bc79611c324b544187dc0773aed72 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54039 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Timothy Day <timday@amazon.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-16356 hsm: store crh in rhashtable instead of list Store coordinator restore handles in rhashtable instead of list. Search in a list with above a million entries takes too much time causing to wait a lot of tasks due to contention on cdt_restore_lock. As cdt_restore_lock is not needed anymore to protect cdt_restore_handle_list, this patch also solves the problem with parallel restore requests(LU-15132). Add regression test sanity-hsm 409b. Fixes: 66b3e74bc ("LU-15132 hsm: Protect against parallel HSM restore requests") Test-Parameters: testlist=sanity-hsm env=ONLY=409b,ONLY_REPEAT=20 HPE-bug-id: LUS-11055 Change-Id: I3bb8788f6a0ce4c3fe4a3be85804df1c6845c313 Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com> Signed-off-by: Etienne AUJAMES <eaujames@ddn.com> Signed-off-by: Nikitas Angelinas <nikitas.angelinas@hpe.com> Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49284 Reviewed-by: Oleg Drokin <green@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com>
LU-17181 misc: don't block reclaim threads memory reclaim threads may blocked by lustre reclaim process, but lustre don't have any benifit from parallel reclaim. Test-Parameters: trivial HPe-bug-id: LUS-11872 Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com> Change-Id: I624edbb8833975864706ec51537d2954f5a9cea4 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52627 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-16952 debug: don't put extra new line at output n already in output line. HPe-bug-id: LUS-11707 Test-Parameters: trivial Signed-off-by: Alexey Lyashkov <alexey.lyashkov@hpe.com> Change-Id: I30667b5fe269aa8b80d5b2101d397f34b75f8e30 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51675 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-8191 obdclass: add static and remove functions Static analysis shows that a number of functions could be made static. This patch declares several functions in obdclass static. There are a few functions which are never called anywhere. These are removed. Additionally, there is some debugging code (added 15 years ago) that has also been removed. Test-Parameters: trivial Signed-off-by: Timothy Day <timday@amazon.com> Change-Id: I5f1d438c9663e62789d26093ec9bdd5d76a3060a Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51440 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Neil Brown <neilb@suse.de> Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Reviewed-by: jsimmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-12610 obd: remove OBD_ -> CFS_ macros Remove OBD macros that are simply redefinitions of CFS macros. Signed-off-by: Timothy Day <timday@amazon.com> Signed-off-by: Ben Evans <beevans@whamcloud.com> Change-Id: Id9e312a6074c5e11370f018afd3201d73b53e7e0 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50808 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-16351 llite: Linux 6.1 prandom, folios_contig, vma_iterator Linux commit v4.10-rc3-6-gc440408cf690 random: convert get_random_int/long into get_random_u32/u64 Linux commit v6.0-11338-gde492c83cae0 prandom: remove unused functions prandom_u32 is a wrapper around get_random_u32, change users of prandom_u32 to get_random_u32 and provide a fallback to prandom_u32 when get_random_u32 is not available. Linux commit v6.0-rc1-2-g25885a35a720 Change calling conventions for filldir_t Add a test for the new filldir_t signature Provide wrappers for transition from int (error code) to bool Linux commit v6.0-rc3-94-g35b471467f88 filemap: add filemap_get_folios_contig() Provide a wrapper and fallback to find_get_pages_contig Linux commit v6.0-rc3-225-gf39af05949a4 mm: add VMA iterator Use vma_iterator and for_each_vma when available. Test-Parameters: trivial HPE-bug-id: LUS-11377 Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com> Change-Id: I23dc23d0252e1995555b6685f5cf7c207edf642b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49232 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com> Reviewed-by: xinliang <xinliang.liu@linaro.org> Reviewed-by: Yang Sheng <ys@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-16231 misc: rename lprocfs_stats functions Rename lprocfs_{alloc,register,clear,free}_stats() to be lprocfs_stats_*() so these functions can be found more easily in relation to struct lprocfs_stats. Test-Parameters: trivial Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Change-Id: I671284a86ee2a1fd3c58da75923f9467e72540e5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48847 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Ellis Wilson <elliswilson@microsoft.com> Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-15642 obdclass: use consistent stats units Use consistent stats units, since some were "usec" and others "usecs". Most stats already use LPROCFS_TYPE_* to encode type stats type, so use this to provide units for those stats, and only explicitly provide strings for the few stats that don't match the commonly-used units. This also reduces the number of repeat static strings in the modules. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Change-Id: I25f31478f238072ddbf9a3918cd43bb08c3ebbe5 Reviewed-on: https://review.whamcloud.com/46833 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Jian Yu <yujian@whamcloud.com> Reviewed-by: Ben Evans <beevans@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-14475 log: Rewrite some log messages Some log messages are too short to be meaningful. Rewrite them. Signed-off-by: Lei Feng <flei@whamcloud.com> Test-Parameters: trivial Change-Id: I9ae7d7da23c7e227c4e2b84010fb0c2a06b8cc87 Reviewed-on: https://review.whamcloud.com/41892 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>
LU-14752 obdclass: handle EBUSY returned for lu_object hashtable When the rhashtable grows to a certain size it will be rescaled. When rescaling you can be returned a ENOMEM or EBUSY error. This we reported as: LustreError: 3594004:0:(lu_object.c:2472:lu_object_assign_fid()) ASSERTION( rc == 0 ) failed: failed hashtable insertion: rc = -16 LustreError: 3594004:0:(lu_object.c:2472:lu_object_assign_fid()) LBUG Pid: 3594004, comm: mdt01_020 4.18.0-240.22.1.1toss.t4.x86_64 #1 SMP Tue Apr 13 17:18:40 PDT 2021 Call Trace TBD: Kernel panic - not syncing: LBUG ... Call Trace: dump_stack+0x5c/0x80 panic+0xe7/0x2a9 lbug_with_loc.cold.10+0x18/0x18 [libcfs] lu_object_assign_fid+0x3b8/0x3c0 [obdclass] Add handling the EBUSY case for our lu_object hash. Fixes: aff14dbc522 ("LU-8130 lu_object: convert lu_object cache to rhashtable") Change-Id: Id85f32633117e02850b799e8d95e3e35d982cbd4 Signed-off-by: James Simmons <jsimmons@infradead.org> Reviewed-on: https://review.whamcloud.com/43968 Tested-by: jenkins <devops@whamcloud.com> Reviewed-by: Gian-Carlo DeFazio <defazio1@llnl.gov> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Neil Brown <neilb@suse.de> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-14487 modules: remove references to Sun Trademark. "lustre" is no longer a Trademark of Sun Microsystems. There is no need to acknowledge the trademark in every file, so just remove all these claims. Test-Parameters: trivial Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I66941494eabc54bedf85079c5b85701187f2a8f1 Reviewed-on: https://review.whamcloud.com/42139 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Aurelien Degremont <degremoa@amazon.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-14352 various: only use wake_up_all() on exclusive waitqs wake_up_all() is not necessary of wait_queues which are not the subject of an exclusive waiter. When all waiters are non-exclusive, wake_up() will wake them all up. Use of wake_up_all() suggests to the reader that the queue is subject to exclusive waits. When that is not the case, the usage can cause confusion. So change all wake_up_all() on non-exclusive waitqueues to wake_up(). The only wait_queues on which exclusive waits are requested are: ws_waitq ibs_waitq kss_waitq ksnd_connd_waitq blp_waitq imp_replay_waitq cl_mod_rpcs_waitq cl_cache_waiters cl_destroy_waitq scp_waitq All others now only use wake_up(). Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I8e4a82747a93a50344cf545f1ae51fffc432b788 Reviewed-on: https://review.whamcloud.com/41289 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Yang Sheng <ys@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-12477 lustre: check return status of register_shrinker() register_shrinker() can fail with -ENOMEM. We should check for that and abort the relevant initialization functions when it happens. For ldlm_pools, ldlm_pools_fini() can be called when ldlm_pools_init() fails, or even in case where it hasn't been called. So add a static flag to ensure we ldlm_pools_fini() does undo things that haven't been done. For lu_global_init() we need to add proper cleanup if anything fails. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: Ie66326486c7738547d4211095bb1d37dc75e0b6a Reviewed-on: https://review.whamcloud.com/40883 Tested-by: jenkins <devops@whamcloud.com> Reviewed-by: Yang Sheng <ys@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-12477 libcfs: Further reduce complexity for shrinkers. Commit c4c17fa4a3f5 ("LU-12477 libcfs: Remove obsolete config checks") reduced the complexity of shinkers by removing support for older kernels, but could have gone a lot further. This patch adds further simplification. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: Ibcc84f61e542b503f795b16a7144e430f8b73582 Reviewed-on: https://review.whamcloud.com/40831 Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-14291 lustre: only include nrs headers when needed Various lustre_nrs_*.h header are only needed on the server. Make this explicit, so it is easier to see which files are needed on the client. Test-Parameters: trivial Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I9bc30acc4f62ea9af516055edbb7833919811089 Reviewed-on: https://review.whamcloud.com/41128 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-12542 osd: consolidate RCU handling Consolidate lu_object_header_fini() and kfree_rcu() into a single lu_object_header_free() function so that callers which do not need a container for lu_object_header can avoid duplicating common RCU and OBD_FREE handling code. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Change-Id: I0fa68f11b5008ede5a498d38b69ccaeecf3ebbe5 Reviewed-on: https://review.whamcloud.com/40204 Tested-by: jenkins <devops@whamcloud.com> Reviewed-by: Ben Evans <beevans@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Neil Brown <neilb@suse.de> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-13511 obdclass: don't initialize obj for zero FID Object with zero FID is used in stripe allocation, and it's meaningless to initialize such object via lu_object_find_at(), return error early to avoid assertion in lu_object_put(). Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com> Change-Id: Ia1bda3d01ff7552e94f31a9c928868652937d559 Reviewed-on: https://review.whamcloud.com/39792 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Stephane Thiell <sthiell@stanford.edu> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-11814 obdcalss: ensure LCT_QUIESCENT take sync Add locking in lu_device_init ensure LCT_QUIESCENT operating can be seen on other thread in parallel mounting. Also add extra checking before unset the flag to make sure we don't do it after device has been started. (osd_handler.c:7730:osd_device_init0()) ASSERTION( info ) failed: (osd_handler.c:7730:osd_device_init0()) LBUG Pid: 28098, comm: mount.lustre 3.10.0-1062.9.1.el7_lustre.x86_64 Call Trace: libcfs_call_trace+0x8c/0xc0 [libcfs] lbug_with_loc+0x4c/0xa0 [libcfs] osd_device_alloc+0x778/0x8f0 [osd_ldiskfs] obd_setup+0x129/0x2f0 [obdclass] class_setup+0x48f/0x7f0 [obdclass] class_process_config+0x190f/0x2830 [obdclass] do_lcfg+0x258/0x500 [obdclass] lustre_start_simple+0x88/0x210 [obdclass] server_fill_super+0xf55/0x1890 [obdclass] lustre_fill_super+0x498/0x990 [obdclass] mount_nodev+0x4f/0xb0 lustre_mount+0x18/0x20 [obdclass] mount_fs+0x3e/0x1b0 vfs_kern_mount+0x67/0x110 do_mount+0x1ef/0xce0 SyS_mount+0x83/0xd0 system_call_fastpath+0x25/0x2a 0xffffffffffffffff Kernel panic - not syncing: LBUG Signed-off-by: Yang Sheng <ys@whamcloud.com> Change-Id: Iccf3d545a5fc7c4a3b2320f1c7c7edcfbc1d17bb Reviewed-on: https://review.whamcloud.com/38416 Tested-by: jenkins <devops@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Wang Shilong <wshilong@ddn.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>