LU-6142 fid: Fix style issues for fid_internal.h This patch fixes issues reported by checkpatch for file lustre/fid/fid_internal.h Test-Parameters: trivial Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Change-Id: I73cf72c107879b341ff868b437dc36649083e2fd Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53999 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Timothy Day <timday@amazon.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-6142 fid: Fix style issues for fid_lib/lproc_fid.c This patch fixes issues reported by checkpatch for file lustre/fid/fid_lib.c and lustre/fid/lproc_fid.c Test-Parameters: trivial Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com> Change-Id: I829027962170e9494e6ff726804a579dd987dc17 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53887 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Timothy Day <timday@amazon.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-9859 libcfs: refactor libcfs initialization. Many lustre modules depend on libcfs having initialized properly, but do not explicit check that it did. When lustre is built as discrete modules, this does not cause a problem because if the libcfs module fails initialization, the other modules don't even get loaded. When lustre is compiled into the kernel, all module_init() routines get run, so they need to check the required initialization succeeded. This patch splits out the initialization of libcfs into a new libcfs_setup(), and has all modules call that. The misc_register() call is kept separate as it does not allocate any resources and if it fails, it fails hard - no point in retrying. Other set-up allocates resources and so is best delayed until they are needed, and can be worth retrying. Ideally, the initialization would happen at mount time (or similar) rather than at load time. Doing this requires each module to check dependencies when they are activated rather than when they are loaded. Achieving that is a much larger job that would have to progress in stages. For now, this change ensures that if some initialization in libcfs fails, other modules will fail-safe. Linux-commit: 64bf0b1a079d61e9e059b9dc7a58e064c7d994ae Change-Id: I6b5ecdba0defc6e033f78d8fc2b9be9e26c7f720 Signed-off-by: Mr. NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52700 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Timothy Day <timday@amazon.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-8585 llite: add special fid handling for fhandle API Lustre has been moving its FIDs handling to the fhandle API. This works well for normal files but Lustre has special FIDs that don't map to normal files which are used by user land applications. Add special handling to ll_iget_for_nfs() so the fhandle API can work with these special FIDs. These FIDs should also work with filesets. Change-Id: I4b55d96cc9eea0b1fb898f94c071c8b30c7b2bd5 Signed-off-by: James Simmons <jsimmons@infradead.org> Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51707 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Etienne AUJAMES <eaujames@ddn.com> Reviewed-by: Neil Brown <neilb@suse.de> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-8191 lustre: convert ec,fid,ldlm,quota functions to static Static analysis shows that a number of functions could be made static. This patch declares several functions in ec, fid, ldlm, and quota static. Test-Parameters: trivial Signed-off-by: Timothy Day <timday@amazon.com> Change-Id: Ic64bdf0d802fd4c963b7b7d3a654575ebde5c07d Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51476 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 misc: remove OBD_ -> CFS_ macros Remove OBD macros that are simply redefinitions of CFS macros. Test-Parameters: trivial Signed-off-by: Timothy Day <timday@amazon.com> Signed-off-by: Ben Evans <beevans@whamcloud.com> Change-Id: I15fe8aa22cb0203bed102a35361f4854ddaabecb Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50809 Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Neil Brown <neilb@suse.de> Reviewed-by: Oleg Drokin <green@whamcloud.com> Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com>
LU-11912 ofd: reduce LUSTRE_DATA_SEQ_MAX_WIDTH Reduce LUSTRE_DATA_SEQ_MAX_WIDTH from ~4B to ~32M to limit the number of objects under /O/[seq]/d[0..31] dir on OSTs. This makes the directories stay optimial for ldiskfs, to avoid going into the largedir/3-level htree territory. Remove the hard-coded LUSTRE_DATA_SEQ_MAX_WIDTH checks in ofd, make them check the seq->lcs_width which is a tunable set to LUSTRE_DATA_SEQ_MAX_WIDTH by default, allow the value up to IDIF_MAX_OID if a larger seq width is needed. Use the odbo->o_size in the OST_CREATE rpc reply on ofd, to update osp with the current seq width setting. osp then uses this seq width to determine when to rollover to a new seq. The seq will rollover when the seq width is exhausted, the default is LUSTRE_DATA_SEQ_MAX_WIDTH. For seq >= FID_SEQ_NORMAL objects, the upper limit of seq width is OBIF_MAX_OID, For IDIF/MDT0 objects, the upper limit is IDIF_MAX_OID. The seq FID_SEQ_OST_MDT0 will change to a normal seq after the rollover. Fix osp_precreate_reserve when the last precreated is the end of the seq and the osp_objs_precreated can not host all the requested objects, the mdt thread would stuck: it wakes up osp precreate thread in a loop for progress, but osp thread will not try to do anything until the seq is used up. This can be seen easier when seq->lcs_width is set to a low number and try to create an overstripe with stripe number bigger than seq->lcs_width. Fix the precreate thread spinning when the precreate pool is at the end of the seq, and is nearly empty. Change the seq->lcs_width to 16384 for all tests in test-framework.sh, except a few slow tests to avoid timeouts, and some overstriping tests creating LOV_MAX_STRIPE_COUNT to avoid overstriping creating less objects than expected, when precreate pool is at the end of the seq, and there are not enough objects. Fix the problem where seq could still change after replay_barrier. To achieve this, introduce new fail_loc OBD_FAIL_OSP_FORCE_NEW_SEQ and force_new_seq/force_new_seq_all to drain the objects in the precreate pool then rollover to a new seq. This applies to a bunch of test suites heavily using replay_barrier. Change-Id: I2749c1004b7bf3197b691cc94527f90145bcdef8 Signed-off-by: Li Dongyang <dongyangli@ddn.com> Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/38424 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-14357 fid: simplify locking for fid updates 'struct lu_client_seq' contains a mutex (lcs_mutex) and a second open-coded mutex (lcs_waitq, lcs_update). Both of these are using in gettign a new fid, possibly from the server. lcs_mutex is the main mutex which protects the local variables. If an RPC to the server is required, the extra mutex is held during that RPC. This was apparently intended to avoid some deadlock, presumably with seq_client_flush(). However as seq_client_flush() now takes both mutexes as well, it is still prone to any such deadlock, but does not appear to actually suffer from one. See: Commit 23e2a370c8a3 ("b=24255 move seq_client_alloc_seq out of lcs_sem") Commit d1feb5c774d4 ("LU-662 fix conflict between seq_client_flush and seq_client_alloc_fid") for some of the history. The extra open-coded mutex appears to provide no value, so let's remove it. As part of this, seq_fid_alloc_fini() is open-coded into the two call sites, which adds further simplification. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: Ia39eca7d925c9d49fbf942923de8af79dba4f6bf Reviewed-on: https://review.whamcloud.com/41299 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com> Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com> 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-6142 lustre: change all 'struct seq_operations' to const All 'struct seq_operations' are now 'static const'. Test-Parameters: trivial Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: Ia0f6a2863835ec02fb7d283a099eea489f65ab3a Reviewed-on: https://review.whamcloud.com/39396 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@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-13985 lustre: seq_file .next functions must update *pos A seq_file .next function must update *pos on EOF to a value which will cause a subsequent ->start to also return EOF. If it doesn't the last record of the file can be returned twice to a 'read()'. Also the seq_file code will generate a warning. This patch fixes various ->next functions to always update *pos. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: Ia0c432cd50550ecde6b308cbc554b316fa03adae Reviewed-on: https://review.whamcloud.com/40035 Tested-by: jenkins <devops@whamcloud.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Chris Horn <chris.horn@hpe.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-9325 fld: replace simple_strto* with kstr* functions The fldb debugfs files use simple_strto* to parse input from the user. simple_strto* is considered obsolete so replace it with the equivalent kstrto* functions. Change-Id: I6d32939152ee0d65df4ec45937d7d0be03b8274e Test-Parameters: trivial env=ONLY=68 testlist=conf-sanity Signed-off-by: James Simmons <jsimmons@infradead.org> Reviewed-on: https://review.whamcloud.com/39498 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Neil Brown <neilb@suse.de> Reviewed-by: Jian Yu <yujian@whamcloud.com> Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-6142 lustre: use init_wait(), not init_waitqueue_entry() init_waitqueue_entry(foo, current) is equivalent to init_wait(foo) So use the shorter version - in lustre and libcfs. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I621364d8f6b155df3f2159dfca39f252abc81c76 Reviewed-on: https://review.whamcloud.com/39300 Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com> Tested-by: jenkins <devops@whamcloud.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-13344 all: Separate debugfs and procfs handling Linux 5.6 introduces proc_ops with v5.5-8862-gd56c0d45f0e2 proc: decouple proc from VFS with "struct proc_ops" Separate debugfs usage and procfs usage to prepare for the divergence of debugfs using file_operations and procfs using proc_ops HPE-bug-id: LUS-8589 Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com> Change-Id: I1746e563b55a9e89f90ac01843c304fe6b690d8b Reviewed-on: https://review.whamcloud.com/37834 Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com> Reviewed-by: Neil Brown <neilb@suse.de> 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-6142 lustre: convert some container_of0 to container_of Each of these calls to container_of0() can be determined from local context to be passed a valid pointer, so it is best to use container_of() directly to make this clear. Either: - the returned pointer is dereferenced with out be tests, or - the passed-in pointer is dereferened before the call, or - the passed-in pointer cannot be NULL, such as when it is a '.next' of a list_head or returned by lu_obecjt_next() So convert all of these to container_of() ... except one which *should* be container_of(), but cannot be as it won't compile cleanly on older kernels. Change that one to container_of_safe() with a big comment. Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: Idcd954f89ed366882563810ce042a5ddaba5a1e5 Reviewed-on: https://review.whamcloud.com/38383 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Yingjin Qian <qian@ddn.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-6142 fid: Fix style issues for fid_store.c This patch fixes issues reported by checkpatch for file lustre/fid/fid_store.c Test-Parameters: trivial Signed-off-by: Arshad Hussain <arshad.super@gmail.com> Change-Id: I66c039e18963d2596f681a89c7ea1f30967d8879 Reviewed-on: https://review.whamcloud.com/38276 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: James Simmons <jsimmons@infradead.org>
LU-6142 fid: Fix style issues for fid_request.c This patch fixes issues reported by checkpatch for file lustre/fid/fid_request.c Test-Parameters: trivial Signed-off-by: Arshad Hussain <arshad.super@gmail.com> Change-Id: I4530180cefc3f8677ca66a0ada7150a5dbfb1520 Reviewed-on: https://review.whamcloud.com/38270 Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com> Reviewed-by: James Simmons <jsimmons@infradead.org>
LU-6142 fid: Fix style issues for fid_handler.c This patch fixes issues reported by checkpatch for file lustre/fid/fid_handler.c Test-Parameters: trivial Signed-off-by: Arshad Hussain <arshad.super@gmail.com> Change-Id: I78291185d592a04e457ad6fd5fb2964c27e08733 Reviewed-on: https://review.whamcloud.com/38271 Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com> Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com> Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
LU-6142 lustre: remove ldebugfs_seq_create wrapper function It was just calling debugfs_create_file() so unwind things and just call the real function instead. This ends up saving a number of lines as there was never any error handling happening anyway, so that all can be removed as well. Test-Parameters: trivial Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mr NeilBrown <neilb@suse.de> Change-Id: I7103ef2a44348f28b958730413e93e0878eba4d2 Reviewed-on: https://review.whamcloud.com/37745 Reviewed-by: Andreas Dilger <adilger@whamcloud.com> Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com> Reviewed-by: James Simmons <jsimmons@infradead.org> Tested-by: jenkins <devops@whamcloud.com> Tested-by: Maloo <maloo@whamcloud.com>