lustre: sync to OpenSFS as of July 18, 2021
cover lustre: sync to OpenSFS as of July 18, 2021
Backport patches from OpenSFS tree as of July 18, 2021.
Amir Shehata (1):
lnet: RMDA infrastructure updates
Arshad Hussain (1):
lnet: libcfs: Add checksum speed under /sys/fs
Bobi Jam (1):
lustre: llite: failed ASSERTION(ldlm_has_layout(lock))
Chris Horn (1):
lnet: Correct peer NI recovery age out calculation
Dominique Martinet (1):
lnet: annotate LNET_WIRE_HANDLE_COOKIE_NONE as u64
Lai Siyao (2):
lustre: lmv: compare space to mkdir on parent MDT
lustre: llite: reset pfid after dir migration
Mike Marciniszyn (2):
lnet: o2iblnd: Move racy NULL assignment
lnet: o2iblnd: Avoid double posting invalidate
Mikhail Pershin (1):
lustre: uapi: per-user changelog names and mask
Mr. NeilBrown (1):
lustre: statahead: update task management code
Qian Yingjin (2):
lustre: llite: simplify callback handling for async getattr
lustre: pcc: introducing OBD_CONNECT2_PCCRO flag
Sebastien Buisson (2):
lustre: quota: nodemap squashed root cannot bypass quota
lustre: sec: migrate/extend/split on encrypted file
Serguei Smirnov (1):
lnet: use ni fatal error when calculating net health
Wang Shilong (2):
lustre: quota: add get/set project support for non-dir/file
lustre: readahead: fix to reserve min pages
fs/lustre/include/lu_object.h | 3 +- fs/lustre/include/lustre_crypto.h | 2 + fs/lustre/include/obd.h | 34 +-- fs/lustre/include/obd_class.h | 4 +- fs/lustre/llite/dir.c | 2 + fs/lustre/llite/file.c | 117 +++++++-- fs/lustre/llite/llite_internal.h | 12 +- fs/lustre/llite/llite_lib.c | 28 ++- fs/lustre/llite/namei.c | 101 +++++++- fs/lustre/llite/rw.c | 8 +- fs/lustre/llite/statahead.c | 420 ++++++++++++-------------------- fs/lustre/lmv/lmv_obd.c | 23 +- fs/lustre/mdc/mdc_internal.h | 3 +- fs/lustre/mdc/mdc_locks.c | 31 ++- fs/lustre/obdclass/llog_swab.c | 17 +- fs/lustre/obdclass/lu_tgt_descs.c | 11 +- fs/lustre/obdclass/obd_sysfs.c | 61 +++++ fs/lustre/osc/osc_cache.c | 2 +- fs/lustre/ptlrpc/wiretest.c | 29 ++- include/linux/libcfs/libcfs_crypto.h | 3 + include/linux/lnet/lib-lnet.h | 1 + include/linux/lnet/lib-types.h | 2 + include/uapi/linux/lnet/lnet-types.h | 2 +- include/uapi/linux/lustre/lustre_idl.h | 22 ++ include/uapi/linux/lustre/lustre_user.h | 18 +- net/lnet/klnds/o2iblnd/o2iblnd.c | 4 +- net/lnet/klnds/o2iblnd/o2iblnd.h | 1 + net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 16 +- net/lnet/libcfs/linux-crypto.c | 3 +- net/lnet/lnet/api-ni.c | 5 +- net/lnet/lnet/lib-md.c | 29 ++- net/lnet/lnet/peer.c | 3 +- 32 files changed, 625 insertions(+), 392 deletions(-)
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 1/18 lustre: statahead: update task management code
From: "Mr. NeilBrown" <[email protected]>
When the rewrite to remove ptlrpc_thread from statahead was ported to OpenSFS, a number of improvements were made. This patch back-ports those to Linux
And import bug-fix is in ll_agl_add() where we now call wake_up_process() inside a spinlock, so we can be sure the task pointer is not NULL.
A few while-loops waiting for events have been simplified to only check each 'continue' condition once instead of checking before doing an action, then checking it before sleeping.
WC-bug-id: https://jira.whamcloud.com/browse/LU-12780
Lustre-commit: 5b630935452d5d8d7 ("LU-12780 llite: don't use ptlrpc_thread for sai_agl_thread")
Lustre-commit: 6bf49037b3a134587 ("LU-12780 llite: avoid ptlrpc_thread for ll_statahead_thread")
Reviewed-on: https://review.whamcloud.com/36258
Reviewed-on: https://review.whamcloud.com/36259
--- fs/lustre/llite/statahead.c | 95 +++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 46 deletions(-)
fs/lustre/llite/statahead.c +49 -46
@@ -35,6 +35,7 @@#include <linux/mm.h> #include <linux/highmem.h> #include <linux/pagemap.h> +#include <linux/delay.h> #define DEBUG_SUBSYSTEM S_LLITE
@@ -299,7 +300,6 @@ static void sa_put(struct ll_statahead_info *sai, struct sa_entry *entry,if (sai->sai_task)wake_up_process (sai->sai_task);spin_unlock (&lli->lli_sa_lock); - }/*
@@ -898,37 +898,40 @@ static int ll_agl_thread(void *arg)CDEBUG (D_READA ,"agl thread started: sai %p, parent %pd\n" , sai, parent); -while (!kthread_should_stop ()) { - +while (({set_current_state (TASK_IDLE ); + !kthread_should_stop (); })) {spin_lock (&plli->lli_agl_lock); -/* The statahead thread maybe help to process AGL entries, -* so check whether list empty again. -*/ clli =list_first_entry_or_null (&sai->sai_agls, struct ll_inode_info, lli_agl_list);if (clli) { +__set_current_state (TASK_RUNNING );list_del_init (&clli->lli_agl_list);spin_unlock (&plli->lli_agl_lock);ll_agl_trigger (&clli->lli_vfs_inode, sai);cond_resched (); }else {spin_unlock (&plli->lli_agl_lock); - } - -set_current_state (TASK_IDLE ); -if (list_empty (&sai->sai_agls) && - !kthread_should_stop ())schedule (); -__set_current_state (TASK_RUNNING ); + } } +__set_current_state (TASK_RUNNING );return 0 ; }static void ll_stop_agl (struct ll_statahead_info *sai) { -struct ll_inode_info *plli =ll_i2info (sai->sai_dentry->d_inode); +struct dentry *parent = sai->sai_dentry; +struct ll_inode_info *plli =ll_i2info (parent->d_inode);struct ll_inode_info *clli; +struct task_struct *agl_task; + +spin_lock (&plli->lli_agl_lock); + agl_task = sai->sai_agl_task; + sai->sai_agl_task =NULL ; +spin_unlock (&plli->lli_agl_lock); +if (!agl_task) +return ;CDEBUG (D_READA ,"stop agl thread: sai %p pid %u\n" , sai, (unsigned int )sai->sai_agl_task->pid);
@@ -1076,14 +1079,19 @@ static int ll_statahead_thread(void *arg)fid_le_to_cpu (&fid, &ent->lde_fid); - do { - sa_handle_callback(sai); +while (({set_current_state (TASK_IDLE ); + sai->sai_task; })) { +if (sa_has_callback (sai)) { +__set_current_state (TASK_RUNNING ); +sa_handle_callback (sai); + }spin_lock (&lli->lli_agl_lock);while (sa_sent_full (sai) && !agl_list_empty (sai)) {struct ll_inode_info *clli; +__set_current_state (TASK_RUNNING ); clli =list_first_entry (&sai->sai_agls, struct ll_inode_info, lli_agl_list);
@@ -1097,15 +1105,11 @@ static int ll_statahead_thread(void *arg) }spin_unlock (&lli->lli_agl_lock); -set_current_state (TASK_IDLE ); -if (sa_sent_full (sai) && - !sa_has_callback (sai) && -agl_list_empty (sai) && - sai->sai_task) -/* wait for spare statahead window */ -schedule (); -__set_current_state (TASK_RUNNING ); - }while (sa_sent_full (sai) && sai->sai_task); +if (!sa_sent_full (sai)) +break ; +schedule (); + } +__set_current_state (TASK_RUNNING );sa_statahead (parent, name, namelen, &fid); }
@@ -1138,21 +1142,18 @@ static int ll_statahead_thread(void *arg)* statahead is finished, but statahead entries need to be cached, wait * for file release to stop me. */ -while (sai->sai_task) { -sa_handle_callback (sai); - -set_current_state (TASK_IDLE ); -/* ensure we see the NULL stored by -* ll_deauthorize_statahead() -*/ -if (!sa_has_callback (sai) && -smp_load_acquire (&sai->sai_task)) +while (({set_current_state (TASK_IDLE ); + sai->sai_task; })) { +if (sa_has_callback (sai)) { +__set_current_state (TASK_RUNNING ); +sa_handle_callback (sai); + }else {schedule (); -__set_current_state (TASK_RUNNING ); + } } +__set_current_state (TASK_RUNNING ); out: -if (sai->sai_agl_task) -ll_stop_agl (sai); +ll_stop_agl (sai);/* * wait for inflight statahead RPCs to finish, and then we can free sai
@@ -1160,7 +1161,7 @@ static int ll_statahead_thread(void *arg)*/ while (sai->sai_sent != sai->sai_replied) {/* in case we're not woken up, timeout wait */ -schedule_timeout_idle (HZ >>3 ); +msleep (125 ); }/* release resources held by statahead RPCs */
@@ -1176,7 +1177,7 @@ static int ll_statahead_thread(void *arg)wake_up (&sai->sai_waitq);ll_sai_put (sai); -do_exit (rc); +return rc; }/* authorize opened dir handle @key to statahead */
@@ -1220,18 +1221,15 @@ void ll_deauthorize_statahead(struct inode *dir, void *key) sai = lli->lli_sai;if (sai && sai->sai_task) {/* -* statahead thread may not quit yet because it needs to cache -* entries, now it's time to tell it to quit. +* statahead thread may not have quit yet because it needs to +* cache entries, now it's time to tell it to quit. * -* In case sai is released, wake_up() is called inside spinlock, -* so we use smp_store_release() to serialize ops. +* wake_up_process() provides the necessary barriers +* to pair with set_current_state(). */ struct task_struct *task = sai->sai_task; -/* ensure ll_statahead_thread sees the NULL before -* calling schedule() again. -*/ -smp_store_release (&sai->sai_task,NULL ); + sai->sai_task =NULL ;wake_up_process (task); }spin_unlock (&lli->lli_sa_lock);
@@ -1510,6 +1508,11 @@ static int revalidate_statahead_dentry(struct inode *dir, ldd =ll_d2d (*dentryp); ldd->lld_sa_generation = lli->lli_sa_generation;sa_put (sai, entry, lli); +spin_lock (&lli->lli_sa_lock); +if (sai->sai_task) +wake_up_process (sai->sai_task); +spin_unlock (&lli->lli_sa_lock); +return rc; }
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 2/18 lustre: llite: simplify callback handling for async getattr
In reply to James SimmonsFrom: Qian Yingjin <[email protected]>
In this patch, it prepares the inode and set lock data directly in the callback interpret of the intent async getattr RPC request (in ptlrpcd context), simplifies the old impementation that defer this work in the statahead thread.
According to the benchmark result, the workload "ls -l" to a large directory on a client without any caching (server and client), containing 1M files (47001 bytes) shows the results with measured elapsed time:
- w/o patch: 180 seconds;
- w patch: 181 seconds;
There is no any obvious performance regession.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14139
Lustre-commit: cbaaa7cde45f593 ("LU-14139 llite: simplify callback handling for async getattr")
Reviewed-on: https://review.whamcloud.com/40712
--- fs/lustre/include/obd.h | 34 ++-- fs/lustre/include/obd_class.h | 4 +- fs/lustre/llite/llite_internal.h | 7 +- fs/lustre/llite/statahead.c | 343 ++++++++++++++------------------------- fs/lustre/lmv/lmv_obd.c | 6 +- fs/lustre/mdc/mdc_internal.h | 3 +- fs/lustre/mdc/mdc_locks.c | 31 ++-- 7 files changed, 160 insertions(+), 268 deletions(-)
fs/lustre/include/obd.h +20 -14
@@ -818,18 +818,24 @@ struct md_callback { void *data, int flag); }; -struct md_enqueue_info ; -/* metadata stat-ahead */ - -struct md_enqueue_info { -struct md_op_data mi_data; -struct lookup_intent mi_it; -struct lustre_handle mi_lockh; -struct inode *mi_dir; -struct ldlm_enqueue_info mi_einfo; -int (*mi_cb)(struct ptlrpc_request *req, -struct md_enqueue_info *minfo,int rc); -void *mi_cbdata; +enum md_opcode { +MD_OP_NONE =0 , +MD_OP_GETATTR =1 , +MD_OP_MAX , +}; + +struct md_op_item { +enum md_opcode mop_opc; +struct md_op_data mop_data; +struct lookup_intent mop_it; +struct lustre_handle mop_lockh; +struct ldlm_enqueue_info mop_einfo; +int (*mop_cb)(struct req_capsule *pill, +struct md_op_item *item, +int rc); +void *mop_cbdata; +struct inode *mop_dir; +u64 mop_lock_flags; };struct obd_ops {
@@ -1060,8 +1066,8 @@ struct md_ops { const char *name, int namelen, struct lu_fid *fid); -int (*intent_getattr_async)(struct obd_export *, -struct md_enqueue_info *); +int (*intent_getattr_async)(struct obd_export *exp, +struct md_op_item *item);int (*revalidate_lock)(struct obd_export *,struct lookup_intent *,struct lu_fid *,u64 *bits);
fs/lustre/include/obd_class.h +2 -2
@@ -1594,7 +1594,7 @@ static inline int md_init_ea_size(struct obd_export *exp, u32 easize, }static inline int md_intent_getattr_async (struct obd_export *exp, -struct md_enqueue_info *minfo) +struct md_op_item *item) {int rc;
@@ -1605,7 +1605,7 @@ static inline int md_intent_getattr_async(struct obd_export *exp,lprocfs_counter_incr (exp->exp_obd->obd_md_stats,LPROC_MD_INTENT_GETATTR_ASYNC ); -return MDP (exp->exp_obd, intent_getattr_async)(exp, minfo); +return MDP (exp->exp_obd, intent_getattr_async)(exp, item); } static inline int md_revalidate_lock(struct obd_export *exp,
fs/lustre/llite/llite_internal.h +1 -6
@@ -1477,17 +1477,12 @@ struct ll_statahead_info {* is not a hidden one */ unsigned int sai_skip_hidden;/* skipped hidden dentry count */ - unsigned int sai_ls_all:1, /* "ls -al", do stat-ahead for + unsigned int sai_ls_all:1; /* "ls -al", do stat-ahead for* hidden entries */ - sai_in_readpage:1;/* statahead in readdir() */wait_queue_head_t sai_waitq;/* stat-ahead wait queue */ struct task_struct *sai_task;/* stat-ahead thread */ struct task_struct *sai_agl_task;/* AGL thread */ -struct list_head sai_interim_entries;/* entries which got async -* stat reply, but not -* instantiated -*/ struct list_head sai_entries;/* completed entries */ struct list_head sai_agls;/* AGLs to be sent */ struct list_head sai_cache[LL_SA_CACHE_SIZE ];
fs/lustre/llite/statahead.c +118 -225
580 lines not on this page · raw message
fs/lustre/lmv/lmv_obd.c +3 -3
@@ -3431,9 +3431,9 @@ static int lmv_clear_open_replay_data(struct obd_export *exp, }static int lmv_intent_getattr_async (struct obd_export *exp, -struct md_enqueue_info *minfo) +struct md_op_item *item) { -struct md_op_data *op_data = &minfo->mi_data; +struct md_op_data *op_data = &item->mop_data;struct obd_device *obd = exp->exp_obd;struct lmv_obd *lmv = &obd->u.lmv;struct lmv_tgt_desc *ptgt =NULL ;
@@ -3457,7 +3457,7 @@ static int lmv_intent_getattr_async(struct obd_export *exp,if (ctgt != ptgt)return -EREMOTE ; -return md_intent_getattr_async (ptgt->ltd_exp, minfo); +return md_intent_getattr_async (ptgt->ltd_exp, item); } static int lmv_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
fs/lustre/mdc/mdc_internal.h +1 -2
@@ -130,8 +130,7 @@ int mdc_cancel_unused(struct obd_export *exp, const struct lu_fid *fid,int mdc_revalidate_lock (struct obd_export *exp,struct lookup_intent *it,struct lu_fid *fid,u64 *bits); -int mdc_intent_getattr_async (struct obd_export *exp, -struct md_enqueue_info *minfo); +int mdc_intent_getattr_async (struct obd_export *exp,struct md_op_item *item); enum ldlm_mode mdc_lock_match(struct obd_export *exp, u64 flags, const struct lu_fid *fid, enum ldlm_type type,
fs/lustre/mdc/mdc_locks.c +15 -16
@@ -49,7 +49,7 @@struct mdc_getattr_args {struct obd_export *ga_exp; -struct md_enqueue_info *ga_minfo; +struct md_op_item *ga_item; };int it_open_error (int phase,struct lookup_intent *it)
@@ -1360,10 +1360,10 @@ static int mdc_intent_getattr_async_interpret(const struct lu_env *env, {struct mdc_getattr_args *ga = args;struct obd_export *exp = ga->ga_exp; -struct md_enqueue_info *minfo = ga->ga_minfo; -struct ldlm_enqueue_info *einfo = &minfo->mi_einfo; -struct lookup_intent *it = &minfo->mi_it; -struct lustre_handle *lockh = &minfo->mi_lockh; +struct md_op_item *item = ga->ga_item; +struct ldlm_enqueue_info *einfo = &item->mop_einfo; +struct lookup_intent *it = &item->mop_it; +struct lustre_handle *lockh = &item->mop_lockh;struct ldlm_reply *lockrep;u64 flags =LDLM_FL_HAS_INTENT ;
@@ -1388,18 +1388,17 @@ static int mdc_intent_getattr_async_interpret(const struct lu_env *env,if (rc) goto out; - rc =mdc_finish_intent_lock (exp, req, &minfo->mi_data, it, lockh); - + rc =mdc_finish_intent_lock (exp, req, &item->mop_data, it, lockh); out: - minfo->mi_cb (req, minfo, rc); + item->mop_cb (&req->rq_pill, item, rc);return 0 ; }int mdc_intent_getattr_async (struct obd_export *exp, -struct md_enqueue_info *minfo) +struct md_op_item *item) { -struct md_op_data *op_data = &minfo->mi_data; -struct lookup_intent *it = &minfo->mi_it; +struct md_op_data *op_data = &item->mop_data; +struct lookup_intent *it = &item->mop_it;struct ptlrpc_request *req;struct mdc_getattr_args *ga;struct ldlm_res_id res_id;
@@ -1428,11 +1427,11 @@ int mdc_intent_getattr_async(struct obd_export *exp,* to avoid possible races. It is safe to have glimpse handler * for non-DOM locks and costs nothing. */ -if (!minfo->mi_einfo.ei_cb_gl) - minfo->mi_einfo.ei_cb_gl = mdc_ldlm_glimpse_ast; +if (!item->mop_einfo.ei_cb_gl) + item->mop_einfo.ei_cb_gl = mdc_ldlm_glimpse_ast; - rc =ldlm_cli_enqueue (exp, &req, &minfo->mi_einfo, &res_id, &policy, - &flags,NULL ,0 ,LVB_T_NONE , &minfo->mi_lockh,1 ); + rc =ldlm_cli_enqueue (exp, &req, &item->mop_einfo, &res_id, &policy, + &flags,NULL ,0 ,LVB_T_NONE , &item->mop_lockh,1 );if (rc <0 ) {ptlrpc_req_finished (req);return rc;
@@ -1440,7 +1439,7 @@ int mdc_intent_getattr_async(struct obd_export *exp, ga =ptlrpc_req_async_args (ga, req); ga->ga_exp = exp; - ga->ga_minfo = minfo; + ga->ga_item = item; req->rq_interpret_reply = mdc_intent_getattr_async_interpret;ptlrpcd_add_req (req);
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 3/18 lustre: uapi: per-user changelog names and mask
In reply to James SimmonsFrom: Mikhail Pershin <[email protected]>
Allow specifying a name for newly-registered changelog users, rather than the default "clNNN" that is otherwise used. This allows services to register a "well-known" changelog user, rather than having to store the changelog username in HA storage outside of the filesystem.
Each changelog user still has a unique ID appended to it, to allow the changelog_clear and changelog_deregister commands to be run using only the ID if necessary/desired. User name can be used to deregister. User name is also unique per server.
If no name is given, then default "cl" format is used.
With this new functionality, it is possible to specify the name like:
testfs-MDT0000: Registered changelog userid 'cl13-watcher'
Per-user mask is also added to allow specific operation logging on per-user basis. Mask can be set only during registration. Resulting mask from per-server mask and all user masks is used for current changelog operations.
Lustre-commit: a15eb4f13224e14 ("LU-13055 mdd: per-user changelog names and mask")
Reviewed-on: https://review.whamcloud.com/43380
--- fs/lustre/obdclass/llog_swab.c | 17 ++++++++++++----- fs/lustre/ptlrpc/wiretest.c | 23 ++++++++++++----------- include/uapi/linux/lustre/lustre_idl.h | 18 ++++++++++++++++++ include/uapi/linux/lustre/lustre_user.h | 2 +- 4 files changed, 43 insertions(+), 17 deletions(-)
fs/lustre/obdclass/llog_swab.c +12 -5
@@ -185,19 +185,26 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec)* to compute its location at runtime */ tail = (struct llog_rec_tail *)((char *)&cr->cr + -changelog_rec_size (&cr->cr) + - cr->cr.cr_namelen); + rec->lrh_len -sizeof (*tail));break ; }case CHANGELOG_USER_REC : +case CHANGELOG_USER_REC2 : { -struct llog_changelog_user_rec *cur = - (struct llog_changelog_user_rec *)rec; +struct llog_changelog_user_rec2 *cur = + (struct llog_changelog_user_rec2 *)rec;__swab32s (&cur->cur_id);__swab64s (&cur->cur_endrec); - tail = &cur->cur_tail; +if (cur->cur_hdr.lrh_type ==CHANGELOG_USER_REC2 ) { +__swab32s (&cur->cur_mask); + BUILD_BUG_ON(offsetof(typeof(*cur), cur_padding1) == 0); + BUILD_BUG_ON(offsetof(typeof(*cur), cur_padding2) == 0); + BUILD_BUG_ON(offsetof(typeof(*cur), cur_padding3) == 0); + } + tail = (struct llog_rec_tail *)((char *)rec + + rec->lrh_len -sizeof (*tail));break ; }
fs/lustre/ptlrpc/wiretest.c +12 -11
@@ -3567,17 +3567,18 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_logid, lgl_ogen));LASSERTF ((int )sizeof (((struct llog_logid *)0 )->lgl_ogen) ==4 ,"found %lld\n" , (long long )(int )sizeof (((struct llog_logid *)0 )->lgl_ogen)); -BUILD_BUG_ON (OST_SZ_REC !=274730752 ); -BUILD_BUG_ON (MDS_UNLINK_REC !=274801668 ); -BUILD_BUG_ON (MDS_UNLINK64_REC !=275325956 ); -BUILD_BUG_ON (MDS_SETATTR64_REC !=275325953 ); -BUILD_BUG_ON (OBD_CFG_REC !=274857984 ); -BUILD_BUG_ON (LLOG_GEN_REC !=274989056 ); -BUILD_BUG_ON (CHANGELOG_REC !=275120128 ); -BUILD_BUG_ON (CHANGELOG_USER_REC !=275185664 ); -BUILD_BUG_ON (HSM_AGENT_REC !=275251200 ); -BUILD_BUG_ON (LLOG_HDR_MAGIC !=275010873 ); -BUILD_BUG_ON (LLOG_LOGID_MAGIC !=275010875 ); +BUILD_BUG_ON (OST_SZ_REC !=0x10600f00 ); +BUILD_BUG_ON (MDS_UNLINK_REC !=0x10612404 ); +BUILD_BUG_ON (MDS_UNLINK64_REC !=0x10692404 ); +BUILD_BUG_ON (MDS_SETATTR64_REC !=0x10692401 ); +BUILD_BUG_ON (OBD_CFG_REC !=0x10620000 ); +BUILD_BUG_ON (LLOG_GEN_REC !=0x10640000 ); +BUILD_BUG_ON (CHANGELOG_REC !=0x10660000 ); +BUILD_BUG_ON (CHANGELOG_USER_REC !=0x10670000 ); +BUILD_BUG_ON (CHANGELOG_USER_REC2 !=0x10670002 ); +BUILD_BUG_ON (HSM_AGENT_REC !=0x10680000 ); +BUILD_BUG_ON (LLOG_HDR_MAGIC !=0x10645539 ); +BUILD_BUG_ON (LLOG_LOGID_MAGIC !=0x1064553b );/* Checks for struct llog_catid */ LASSERTF((int)sizeof(struct llog_catid) == 32, "found %lld\n",
include/uapi/linux/lustre/lustre_idl.h +18 -0
@@ -2480,6 +2480,7 @@ enum llog_op_type {/* LLOG_JOIN_REC = LLOG_OP_MAGIC | 0x50000, obsolete 1.8.0 */ CHANGELOG_REC =LLOG_OP_MAGIC |0x60000 ,CHANGELOG_USER_REC =LLOG_OP_MAGIC |0x70000 , +CHANGELOG_USER_REC2 =LLOG_OP_MAGIC |0x70002 ,HSM_AGENT_REC =LLOG_OP_MAGIC |0x80000 ,LLOG_HDR_MAGIC =LLOG_OP_MAGIC |0x45539 , LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b,
@@ -2575,6 +2576,8 @@ struct llog_changelog_rec {struct llog_rec_tail cr_do_not_use;/**< for_sizezof_only */ } __attribute__((packed)); +#define CHANGELOG_USER_NAMELEN 16/* base name including NUL terminator */ +struct llog_changelog_user_rec {struct llog_rec_hdr cur_hdr;__u32 cur_id;
@@ -2583,6 +2586,21 @@ struct llog_changelog_user_rec {struct llog_rec_tail cur_tail; } __attribute__((packed)); +/* this is twice the size of CHANGELOG_USER_REC */ +struct llog_changelog_user_rec2 { +struct llog_rec_hdr cur_hdr; +__u32 cur_id; +/* only for use in relative time comparisons to detect idle users */ +__u32 cur_time; +__u64 cur_endrec; +__u32 cur_mask; +__u32 cur_padding1; +char cur_name[CHANGELOG_USER_NAMELEN ]; +__u64 cur_padding2; +__u64 cur_padding3; +struct llog_rec_tail cur_tail; +} __attribute__((packed)); +enum agent_req_status {ARS_WAITING ,ARS_STARTED ,
include/uapi/linux/lustre/lustre_user.h +1 -1
@@ -1248,7 +1248,7 @@ enum changelog_rec_type {CL_RESYNC =22 ,/* FLR: file was resync-ed */ CL_GETXATTR =23 ,CL_DN_OPEN =24 ,/* denied open */ - CL_LAST + CL_LAST, };static inline const char *changelog_type2str (int type)
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 4/18 lnet: Correct peer NI recovery age out calculation
In reply to James SimmonsFrom: Chris Horn <[email protected]>
The calculation to age a peer NI out of recovery is only valid if lnet_recovery_limit is non-zero. When set to zero, we allow peer NIs to be in recovery indefinitely.
HPE-bug-id: LUS-9953
WC-bug-id: https://jira.whamcloud.com/browse/LU-14654
Lustre-commit: 8f3f0e1219724d6e ("LU-14654 lnet: Correct peer NI recovery age out calculation")
Reviewed-on: https://review.whamcloud.com/43501
--- net/lnet/lnet/peer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/lnet/lnet/peer.c +2 -1
@@ -4033,7 +4033,8 @@ int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk)return ; } -if (now > lpni->lpni_last_alive + lnet_recovery_limit) { +if (lnet_recovery_limit && + now > lpni->lpni_last_alive + lnet_recovery_limit) {CDEBUG (D_NET ,"lpni %s aged out last alive %lld\n" ,libcfs_nid2str (lpni->lpni_nid), lpni->lpni_last_alive);
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 5/18 lustre: lmv: compare space to mkdir on parent MDT
In reply to James SimmonsFrom: Lai Siyao <[email protected]>
In QOS subdirectory creation, subdirectories are kept on parent MDT if it is less full than average, however it checks weight other than free space, while "weight = free space - penalty", if MDTs have different penalties, the result is not accurate, therefore this may not work.
Check free space instead, and loosen the critirion to allow the free space within the range of QOS threshold.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14762
Lustre-commit: 002c2a80266b23c1 ("LU-14762 lmv: compare space to mkdir on parent MDT")
Reviewed-on: https://review.whamcloud.com/43997
--- fs/lustre/include/lu_object.h | 3 ++- fs/lustre/lmv/lmv_obd.c | 17 ++++++++++------- fs/lustre/obdclass/lu_tgt_descs.c | 11 ++++++----- 3 files changed, 18 insertions(+), 13 deletions(-)
fs/lustre/include/lu_object.h +2 -1
@@ -1434,7 +1434,7 @@ struct lu_svr_qos {struct obd_uuid lsq_uuid;/* ptlrpc's c_remote_uuid */ struct list_head lsq_svr_list;/* link to lq_svr_list */ u64 lsq_bavail;/* total bytes avail on svr */ -u64 lsq_iavail;/* tital inode avail on svr */ +u64 lsq_iavail;/* total inode avail on svr */ u64 lsq_penalty;/* current penalty */ u64 lsq_penalty_per_obj;/* penalty decrease * every obj
@@ -1451,6 +1451,7 @@ struct lu_tgt_qos {u64 ltq_penalty_per_obj;/* penalty decrease * every obj */ +u64 ltq_avail;/* bytes/inode avail */ u64 ltq_weight;/* net weighting */ time64_t ltq_used;/* last used time, seconds */ bool ltq_usable:1; /* usable for striping */
fs/lustre/lmv/lmv_obd.c +10 -7
@@ -1430,6 +1430,7 @@ static int lmv_close(struct obd_export *exp, struct md_op_data *op_data,static struct lu_tgt_desc *lmv_locate_tgt_qos (struct lmv_obd *lmv,u32 *mdt) {struct lu_tgt_desc *tgt, *cur =NULL ; +u64 total_avail =0 ;u64 total_weight =0 ;u64 cur_weight =0 ;int total_usable =0 ;
@@ -1460,23 +1461,25 @@ static struct lu_tgt_desc *lmv_locate_tgt_qos(struct lmv_obd *lmv, u32 *mdt) tgt->ltd_qos.ltq_usable =1 ;lu_tgt_qos_weight_calc (tgt); -if (tgt->ltd_index == *mdt) { +if (tgt->ltd_index == *mdt) cur = tgt; - cur_weight = tgt->ltd_qos.ltq_weight; - } + total_avail += tgt->ltd_qos.ltq_avail; total_weight += tgt->ltd_qos.ltq_weight; total_usable++; } -/* if current MDT has higher-than-average space, stay on same MDT */ - rand = total_weight / total_usable; -if (cur_weight >= rand) { +/* if current MDT has above-average space, within range of the QOS +* threshold, stay on the same MDT to avoid creating needless remote +* MDT directories. +*/ + rand = total_avail * (256 - lmv->lmv_qos.lq_threshold_rr) / + (total_usable *256 ); +if (cur && cur->ltd_qos.ltq_avail >= rand) { tgt = cur; rc =0 ; goto unlock; } - cur_weight =0 ; rand =lu_prandom_u64_max (total_weight); lmv_foreach_connected_tgt(lmv, tgt) {
fs/lustre/obdclass/lu_tgt_descs.c +6 -5
@@ -220,14 +220,15 @@ static inline u64 tgt_statfs_iavail(struct lu_tgt_desc *tgt)void lu_tgt_qos_weight_calc (struct lu_tgt_desc *tgt) {struct lu_tgt_qos *ltq = &tgt->ltd_qos; -u64 temp, temp2; +u64 penalty; - temp = (tgt_statfs_bavail (tgt) >>16 ) * (tgt_statfs_iavail (tgt) >>8 ); - temp2 = ltq->ltq_penalty + ltq->ltq_svr->lsq_penalty; -if (temp < temp2) + ltq->ltq_avail = (tgt_statfs_bavail (tgt) >>16 ) * + (tgt_statfs_iavail (tgt) >>8 ); + penalty = ltq->ltq_penalty + ltq->ltq_svr->lsq_penalty; +if (ltq->ltq_avail < penalty) ltq->ltq_weight =0 ;else - ltq->ltq_weight = temp - temp2; + ltq->ltq_weight = ltq->ltq_avail - penalty; }EXPORT_SYMBOL (lu_tgt_qos_weight_calc);
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 6/18 lnet: annotate LNET_WIRE_HANDLE_COOKIE_NONE as u64
In reply to James SimmonsFrom: Dominique Martinet <[email protected]>
Fix the following warning on new gcc with -Wextra when including lustre_idl.h on external project:
.../include/linux/lnet/lnet-types.h: In function LNetMDHandleIsInvalid:.../include/linux/lnet/lnet-types.h:355:46:
error: comparison of integer expressions of different signedness:
int and __u64 {aka long long unsigned int} [-Werror=sign-compare]
return (LNET_WIRE_HANDLE_COOKIE_NONE == h.cookie);
^~WC-bug-id: https://jira.whamcloud.com/browse/LU-14093
Lustre-commit: 27214876fcdfbda0 ("LU-14093 lnet: annotate LNET_WIRE_HANDLE_COOKIE_NONE as u64")
Reviewed-on: https://review.whamcloud.com/43713
--- include/uapi/linux/lnet/lnet-types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/lnet/lnet-types.h +1 -1
@@ -134,7 +134,7 @@ struct lnet_counters {* 'me' for match entry). Each type of object is given a unique handle type * to enhance type checking. */ -#define LNET_WIRE_HANDLE_COOKIE_NONE (-1) +#define LNET_WIRE_HANDLE_COOKIE_NONE (~0ULL)struct lnet_handle_md {__u64 cookie;
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 7/18 lnet: libcfs: Add checksum speed under /sys/fs
In reply to James SimmonsFrom: Arshad Hussain <[email protected]>
This patch adds total of registered checksum and all registered checksum names along with their speed under /sys/kernel/debug/lustre/checksum_speed
TestCase sanity/77m added.
Sample output:
$ lctl get_param checksum_speed checksum_speed=adler32: 1955 crc32: 2423 crc32c: 14035
WC-bug-id: https://jira.whamcloud.com/browse/LU-11698
Lustre-commit: d775f9ae37975c85 ("LU-11698 libcfs: Add checksum speed under /sys/fs")
Reviewed-on: https://review.whamcloud.com/43943
--- fs/lustre/obdclass/obd_sysfs.c | 61 ++++++++++++++++++++++++++++++++++++ include/linux/libcfs/libcfs_crypto.h | 3 ++ net/lnet/libcfs/linux-crypto.c | 3 +- 3 files changed, 66 insertions(+), 1 deletion(-)
fs/lustre/obdclass/obd_sysfs.c +61 -0
@@ -59,6 +59,7 @@#include <linux/seq_file.h> #include <linux/kobject.h> +#include <linux/libcfs/libcfs_crypto.h> #include <uapi/linux/lnet/lnetctl.h> #include <obd_support.h> #include <obd_class.h>
@@ -420,6 +421,63 @@ static int obd_device_list_open(struct inode *inode, struct file *file) .release = seq_release, }; +/* checksum_speed */ +static void *checksum_speed_start (struct seq_file *p,loff_t *pos) +{ +return pos; +} + +static void checksum_speed_stop (struct seq_file *p,void *v) +{ +} + +static void *checksum_speed_next (struct seq_file *p,void *v,loff_t *pos) +{ + ++(*pos); +if (*pos >=CFS_HASH_ALG_SPEED_MAX -1 ) +return NULL ; + +return pos; +} + +static int checksum_speed_show (struct seq_file *p,void *v) +{ +loff_t index = *(loff_t *)v; + +if (!index || index >CFS_HASH_ALG_SPEED_MAX -1 ) +return 0 ; + +seq_printf (p,"%s: %d\n" ,cfs_crypto_hash_name (index), + cfs_crypto_hash_speeds[index]); + +return 0 ; +} + +static const struct seq_operations checksum_speed_sops = { + .start = checksum_speed_start, + .stop = checksum_speed_stop, + .next = checksum_speed_next, + .show = checksum_speed_show, +}; + +static int checksum_speed_open (struct inode *inode,struct file *file) +{ +int rc =seq_open (file, &checksum_speed_sops); + +if (rc) +return rc; + +return 0 ; +} + +static const struct file_operations checksum_speed_fops = { + .owner =THIS_MODULE , + .open = checksum_speed_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; +static int health_check_seq_show (struct seq_file *m,void *unused) {
@@ -507,6 +565,9 @@ int class_procfs_init(void)debugfs_create_file ("health_check" ,0444 , debugfs_lustre_root,NULL , &health_check_fops); + +debugfs_create_file ("checksum_speed" ,0444 , debugfs_lustre_root, +NULL , &checksum_speed_fops); out:return rc; }
include/linux/libcfs/libcfs_crypto.h +3 -0
@@ -135,6 +135,9 @@ enum cfs_crypto_hash_alg {return NULL ; } +/* Array of hash algorithm speed in MByte per second */ +extern int cfs_crypto_hash_speeds[CFS_HASH_ALG_MAX ]; +/** * Return hash name for hash algorithm identifier *
net/lnet/libcfs/linux-crypto.c +2 -1
@@ -39,7 +39,8 @@/** * Array of hash algorithm speed in MByte per second */ -static int cfs_crypto_hash_speeds[CFS_HASH_ALG_MAX ]; +int cfs_crypto_hash_speeds[CFS_HASH_ALG_MAX ]; +EXPORT_SYMBOL (cfs_crypto_hash_speeds);/** * Initialize the state descriptor for the specified hash algorithm.
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 8/18 lnet: use ni fatal error when calculating net health
In reply to James SimmonsFrom: Serguei Smirnov <[email protected]>
When ni is flagged with "fatal_error" by LND, its health score remains unaffected. This allows for the net containing such ni to be selected for tx even if it is the only ni in this net. Take "fatal_error" status of the ni into account when calculating the net health score.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14750
Lustre-commit: 86a69f9eb5cab3f9 ("LU-14750 lnet: use ni fatal error when calculating net health")
Reviewed-on: https://review.whamcloud.com/43962
--- net/lnet/lnet/api-ni.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/lnet/lnet/api-ni.c +3 -2
@@ -3103,11 +3103,12 @@ int lnet_get_net_healthv_locked(struct lnet_net *net) {struct lnet_ni *ni;int best_healthv =0 ; -int healthv; +int healthv, ni_fatal;list_for_each_entry (ni, &net->net_ni_list, ni_netlist) { healthv =atomic_read (&ni->ni_healthv); -if (healthv > best_healthv) + ni_fatal =atomic_read (&ni->ni_fatal_error_on); +if (!ni_fatal && healthv > best_healthv) best_healthv = healthv; }
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 9/18 lustre: quota: add get/set project support for non-dir/file
In reply to James SimmonsFrom: Wang Shilong <[email protected]>
Add ablity to get/set non-dir/file's project ID and state.
WC-bug-id: https://jira.whamcloud.com/browse/LU-11872
Lustre-commit: b31792b0e72425c8 ("LU-11872 quota: add get/set project support for non-dir/file")
Reviewed-on: https://review.whamcloud.com/44006
--- fs/lustre/llite/dir.c | 2 + fs/lustre/llite/file.c | 111 ++++++++++++++++++++++++++------ fs/lustre/llite/llite_internal.h | 5 +- fs/lustre/llite/llite_lib.c | 3 +- include/uapi/linux/lustre/lustre_user.h | 16 +++++ 5 files changed, 115 insertions(+), 22 deletions(-)
fs/lustre/llite/dir.c +2 -0
@@ -2098,6 +2098,8 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)return ll_ioctl_fsgetxattr (inode, cmd, arg);case FS_IOC_FSSETXATTR :return ll_ioctl_fssetxattr (inode, cmd, arg); +case LL_IOC_PROJECT : +return ll_ioctl_project (file, cmd, arg);case LL_IOC_PCC_DETACH_BY_FID : {struct lu_pcc_detach_fid *detach;struct lu_fid *fid;
fs/lustre/llite/file.c +91 -20
173 lines not on this page · raw message
fs/lustre/llite/llite_internal.h +4 -1
@@ -1157,11 +1157,14 @@ int ll_migrate(struct inode *parent, struct file *file,int ll_get_fid_by_name (struct inode *parent,const char *name,int namelen,struct lu_fid *fid,struct inode **inode);int ll_inode_permission (struct inode *inode,int mask); -int ll_ioctl_check_project (struct inode *inode,struct fsxattr *fa); +int ll_ioctl_check_project (struct inode *inode,u32 xflags,u32 projid);int ll_ioctl_fsgetxattr (struct inode *inode,unsigned int cmd,unsigned long arg);int ll_ioctl_fssetxattr (struct inode *inode,unsigned int cmd,unsigned long arg); +int ll_ioctl_project (struct file *file,unsigned int cmd, +unsigned long arg); +int ll_lov_setstripe_ea_info (struct inode *inode,struct dentry *dentry,u64 flags,struct lov_user_md *lum,int lum_size);
fs/lustre/llite/llite_lib.c +2 -1
@@ -2615,7 +2615,8 @@ int ll_iocontrol(struct inode *inode, struct file *file,if (flags &LUSTRE_PROJINHERIT_FL ) fa.fsx_xflags =FS_XFLAG_PROJINHERIT ; - rc =ll_ioctl_check_project (inode, &fa); + rc =ll_ioctl_check_project (inode, fa.fsx_xflags, + fa.fsx_projid);if (rc)return rc;
include/uapi/linux/lustre/lustre_user.h +16 -0
@@ -375,6 +375,7 @@ struct ll_ioc_lease_id {#define LL_IOC_PCC_DETACH _IOW('f', 252, struct lu_pcc_detach)#define LL_IOC_PCC_DETACH_BY_FID _IOW('f', 252, struct lu_pcc_detach_fid)#define LL_IOC_PCC_STATE _IOR('f', 252, struct lu_pcc_state) +#define LL_IOC_PROJECT _IOW('f', 253, struct lu_project)#define LL_STATFS_LMV 1#define LL_STATFS_LOV 2
@@ -2311,6 +2312,21 @@ struct lu_pcc_state {char pccs_path[PATH_MAX ]; }; +enum lu_project_type { +LU_PROJECT_NONE =0 , +LU_PROJECT_SET , +LU_PROJECT_GET , +LU_PROJECT_MAX +}; + +struct lu_project { +__u32 project_type;/* enum lu_project_type */ +__u32 project_id; +__u32 project_xflags; +__u32 project_reserved; +char project_name[NAME_MAX +1 ]; +}; +struct fid_array {__u32 fa_nr;/* make header's size equal lu_fid */
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 10/18 lustre: readahead: fix to reserve min pages
In reply to James SimmonsFrom: Wang Shilong <[email protected]>
@pages_min might be larger than @pages which indicate more pages should be read, and it will cause a warning later.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14778
Lustre-commit: 4fc127428f00d6a3 ("LU-14778 readahead: fix to reserve min pages")
Reviewed-on: https://review.whamcloud.com/44050
--- fs/lustre/llite/rw.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
fs/lustre/llite/rw.c +5 -3
@@ -85,8 +85,9 @@ static unsigned long ll_ra_count_get(struct ll_sb_info *sbi,struct ll_ra_info *ra = &sbi->ll_ra_info;long ret; +WARN_ON_ONCE (pages_min > pages);/** -* Don't try readahead agreesively if we are limited +* Don't try readahead aggresively if we are limited * LRU pages, otherwise, it could cause deadlock. */ pages =min (sbi->ll_cache->ccc_lru_max >>2 , pages);
@@ -95,7 +96,7 @@ static unsigned long ll_ra_count_get(struct ll_sb_info *sbi,* this will make us leak @ra_cur_pages, because * ll_ra_count_put() acutally freed @pages. */ -if (WARN_ON_ONCE (pages_min > pages)) +if (unlikely (pages_min > pages)) pages_min = pages;/*
@@ -829,7 +830,8 @@ static int ll_readahead(const struct lu_env *env, struct cl_io *io,/* don't over reserved for mmap range read */ if (skip_index) pages_min =0 ; - +if (pages_min > pages) + pages = pages_min; ria->ria_reserved =ll_ra_count_get (ll_i2sbi (inode), ria, pages, pages_min);if (ria->ria_reserved < pages)
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 11/18 lnet: RMDA infrastructure updates
In reply to James SimmonsFrom: Amir Shehata <[email protected]>
Add infrastructure to force RDMA for payloads < 4K. Add infrastructure to extract the first page in a payload. Useful for determining the type of the payload to be transmitted.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14798
Lustre-commit: 7ac839837c1c6cd1f ("LU-14798 lnet: RMDA infrastructure updates")
Lustre-change: https://review.whamcloud.com/37453
Whamcloud-bug-id: EX-773
Reviewed-on: https://review.whamcloud.com/44109
--- include/linux/lnet/lib-lnet.h | 1 + include/linux/lnet/lib-types.h | 2 ++ net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 4 ++-- net/lnet/lnet/lib-md.c | 29 +++++++++++++++++++++++------ 4 files changed, 28 insertions(+), 8 deletions(-)
include/linux/lnet/lib-lnet.h +1 -0
@@ -711,6 +711,7 @@ void lnet_copy_kiov2iter(struct iov_iter *to,void lnet_md_unlink (struct lnet_libmd *md);void lnet_md_deconstruct (struct lnet_libmd *lmd,struct lnet_event *ev);struct page *lnet_kvaddr_to_page (unsigned long vaddr); +struct page *lnet_get_first_page (struct lnet_libmd *md,unsigned int offset);int lnet_cpt_of_md (struct lnet_libmd *md,unsigned int offset);unsigned int lnet_get_lnd_timeout (void );
include/linux/lnet/lib-types.h +2 -0
@@ -122,6 +122,8 @@ struct lnet_msg {enum lnet_msg_hstatus msg_health_status;/* This is a recovery message */ bool msg_recovery; +/* force an RDMA even if the message size is < 4K */ +bool msg_rdma_force;/* the number of times a transmission has been retried */ int msg_retry_count;/* flag to indicate that we do not want to resend this message */
net/lnet/klnds/o2iblnd/o2iblnd_cb.c +2 -2
@@ -1553,7 +1553,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,/* is the REPLY message too small for RDMA? */ nob = offsetof(struct kib_msg, ibm_u.immediate.ibim_payload[lntmsg->msg_md->md_length]); -if (nob <=IBLND_MSG_SIZE ) +if (nob <=IBLND_MSG_SIZE && !lntmsg->msg_rdma_force)break ;/* send IMMEDIATE */ tx =kiblnd_get_idle_tx (ni, target.nid);
@@ -1599,7 +1599,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,case LNET_MSG_PUT :/* Is the payload small enough not to need RDMA? */ nob = offsetof(struct kib_msg, ibm_u.immediate.ibim_payload[payload_nob]); -if (nob <=IBLND_MSG_SIZE ) +if (nob <=IBLND_MSG_SIZE && !lntmsg->msg_rdma_force)break ;/* send IMMEDIATE */ tx =kiblnd_get_idle_tx (ni, target.nid);
net/lnet/lnet/lib-md.c +23 -6
@@ -87,9 +87,9 @@ struct page *lnet_kvaddr_to_page(unsigned long vaddr) }EXPORT_SYMBOL (lnet_kvaddr_to_page); -int lnet_cpt_of_md (struct lnet_libmd *md,unsigned int offset) +struct page * +lnet_get_first_page (struct lnet_libmd *md,unsigned int offset) { -int cpt =CFS_CPT_ANY ;unsigned int niov;struct bio_vec *kiov;
@@ -102,7 +102,7 @@ int lnet_cpt_of_md(struct lnet_libmd *md, unsigned int offset) md =lnet_handle2md (&md->md_bulk_handle);if (!md || md->md_niov ==0 ) -return CFS_CPT_ANY ; +return NULL ; kiov = md->md_kiov; niov = md->md_niov;
@@ -113,12 +113,29 @@ int lnet_cpt_of_md(struct lnet_libmd *md, unsigned int offset) kiov++;if (niov ==0 ) {CERROR ("offset %d goes beyond iov\n" , offset); - goto out; +return NULL ; } } - cpt =cfs_cpt_of_node (lnet_cpt_table (), -page_to_nid (kiov->bv_page)); +return kiov->bv_page; +} + +int +lnet_cpt_of_md (struct lnet_libmd *md,unsigned int offset) +{ +struct page *page; +int cpt =CFS_CPT_ANY ; + + page =lnet_get_first_page (md, offset); +if (!page) { +CDEBUG (D_NET , +"Couldn't resolve first page of md %p with offset %u\n" , + md, offset); + goto out; + } + + cpt =cfs_cpt_of_node (lnet_cpt_table (),page_to_nid (page)); + out:return cpt; }
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 12/18 lnet: o2iblnd: Move racy NULL assignment
In reply to James SimmonsFrom: Mike Marciniszyn <[email protected]>
kiblnd_fmr_pool_unmap() can race map and subsequent processing because of this flaw in unmap:
if (frd) {
frd->frd_valid = false;
spin_lock(&fps->fps_lock);
list_add_tail(&frd->frd_list, &fpo->fast_reg.fpo_pool_list);
spin_unlock(&fps->fps_lock);
fmr->fmr_frd = NULL;
}The fmr can be pulled off the list in kiblnd_fmr_pool_unmap() on another CPU an fmr_frd could be in a state of flux and potentially be seen incorrectly later on as the kib_tx is processed.
Fix my moving the fmr_frd assignment to before the fmr is added to the list.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14733
Lustre-commit: 023113fb8946f356 ("LU-14733 o2iblnd: Move racy NULL assignment")
Reviewed-on: https://review.whamcloud.com/44189
--- net/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/lnet/klnds/o2iblnd/o2iblnd.c +1 -1
@@ -1539,10 +1539,10 @@ void kiblnd_fmr_pool_unmap(struct kib_fmr *fmr, int status) fps = fpo->fpo_owner;if (frd) { frd->frd_valid = false; + fmr->fmr_frd =NULL ;spin_lock (&fps->fps_lock);list_add_tail (&frd->frd_list, &fpo->fast_reg.fpo_pool_list);spin_unlock (&fps->fps_lock); - fmr->fmr_frd =NULL ; } fmr->fmr_pool =NULL ;
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 13/18 lnet: o2iblnd: Avoid double posting invalidate
In reply to James SimmonsFrom: Mike Marciniszyn <[email protected]>
When the kib_tx is provisioned during kiblnd_fmr_pool_map(), spare WRs in the kib_fast_reg_descriptor are setup and the mapping of pages is given to the mr.
kiblnd_post_tx_locked() then posts the spare WRs from the kib_fast_reg_descriptor.
if (rc == 0)
return 0;
The code returns and the kib_fast_reg_descriptor is still contains
the spare WRs. The next time the kib_tx is used, the
now obsolete WRs will be inadvertently posted. For rdmavt, the
obsolete invalidate will cause an -EINVAL to be returned from the post send.
Fix by adding a state variable frd_posted to the kib_fast_reg_descriptor. The variable is set to false in kiblnd_fmr_pool_unmap(). kiblnd_post_tx_locked() is adjusted to avoid prepending thekib_fast_reg_descriptor WRs when frd_posted is true. After
the post succeeds, the frd_posted is set to true.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14733
Lustre-commit: 5930576791e864529 ("LU-14733 o2iblnd: Avoid double posting invalidate")
Reviewed-on: https://review.whamcloud.com/44190
--- net/lnet/klnds/o2iblnd/o2iblnd.c | 2 ++ net/lnet/klnds/o2iblnd/o2iblnd.h | 1 + net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 12 +++++++----- 3 files changed, 10 insertions(+), 5 deletions(-)
net/lnet/klnds/o2iblnd/o2iblnd.c +2 -0
@@ -1539,6 +1539,7 @@ void kiblnd_fmr_pool_unmap(struct kib_fmr *fmr, int status) fps = fpo->fpo_owner;if (frd) { frd->frd_valid = false; + frd->frd_posted = false; fmr->fmr_frd =NULL ;spin_lock (&fps->fps_lock);list_add_tail (&frd->frd_list, &fpo->fast_reg.fpo_pool_list);
@@ -1634,6 +1635,7 @@ int kiblnd_fmr_pool_map(struct kib_fmr_poolset *fps, struct kib_tx *tx, fmr->fmr_key = is_rx ? mr->rkey : mr->lkey; fmr->fmr_frd = frd; fmr->fmr_pool = fpo; + frd->frd_posted = false;return 0 ; }
net/lnet/klnds/o2iblnd/o2iblnd.h +1 -0
@@ -272,6 +272,7 @@ struct kib_fast_reg_descriptor { /* For fast registration */struct ib_reg_wr frd_fastreg_wr;struct ib_mr *frd_mr;bool frd_valid; +bool frd_posted; };struct kib_fmr_pool {
net/lnet/klnds/o2iblnd/o2iblnd_cb.c +7 -5
@@ -721,6 +721,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,struct kib_msg *msg = tx->tx_msg;struct kib_peer_ni *peer_ni = conn->ibc_peer;struct lnet_ni *ni = peer_ni->ibp_ni; +struct kib_fast_reg_descriptor *frd = tx->tx_fmr.fmr_frd;int ver = conn->ibc_version;int rc;int done;
@@ -809,11 +810,10 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,/* close_conn will launch failover */ rc = -ENETDOWN ; }else { -struct kib_fast_reg_descriptor *frd = tx->tx_fmr.fmr_frd;const struct ib_send_wr *bad = &tx->tx_wrq[tx->tx_nwrq -1 ].wr;struct ib_send_wr *wrq = &tx->tx_wrq[0 ].wr; -if (frd) { +if (frd && !frd->frd_posted) {if (!frd->frd_valid) { wrq = &frd->frd_inv_wr; wrq->next = &frd->frd_fastreg_wr.wr;
@@ -837,11 +837,13 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx, conn->ibc_last_send =ktime_get (); -if (!rc) +if (rc ==0 ) { +if (frd) + frd->frd_posted = true;return 0 ; + } -/* -* NB credits are transferred in the actual +/* NB credits are transferred in the actual * message, which can only be the last work item */ conn->ibc_credits += credit;
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 14/18 lustre: quota: nodemap squashed root cannot bypass quota
In reply to James SimmonsFrom: Sebastien Buisson <[email protected]>
When root on client is squashed via a nodemap's squash_uid/squash_gid, its IOs must not bypass quota enforcement as it normally does without squashing.
So on client side, do not set OBD_BRW_FROM_GRANT for every page being used by root. And on server side, check if root is squashed via a nodemap and remove OBD_BRW_NOQUOTA.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14739
Lustre-commit: a4fbe7341baf12c00 ("LU-14739 quota: nodemap squashed root cannot bypass quota")
Reviewed-on: https://review.whamcloud.com/43988
--- fs/lustre/osc/osc_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/lustre/osc/osc_cache.c +1 -1
@@ -2380,7 +2380,7 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io, }/* check if the file's owner/group is over quota */ -if (!(cmd &OBD_BRW_NOQUOTA )) { +if (!io->ci_noquota) {struct cl_object *obj;struct cl_attr *attr;unsigned int qid[MAXQUOTAS ];
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 15/18 lustre: llite: reset pfid after dir migration
In reply to James SimmonsFrom: Lai Siyao <[email protected]>
A plain directory will be turned into to a stripe upon migration/restripe, and reversely if target is plain directory, the target stripe will be turned into directory after.
In the first case, set pfid, and in the latter case, clear pfid, otherwise ll_lock_cancel_bits() will use the wrong master inode.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14459
Lustre-commit: abbe545a63b304e80 ("LU-14459 llite: reset pfid after dir migration")
Reviewed-on: https://review.whamcloud.com/43289
--- fs/lustre/llite/llite_lib.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
fs/lustre/llite/llite_lib.c +15 -4
@@ -1401,10 +1401,12 @@ static struct inode *ll_iget_anon_dir(struct super_block *sb, struct lustre_md *md) {struct ll_sb_info *sbi =ll_s2sbi (sb); +struct ll_inode_info *lli;struct mdt_body *body = md->body;struct inode *inode;ino_t ino; +LASSERT (md->lmv); ino =cl_fid_build_ino (fid, sbi->ll_flags &LL_SBI_32BIT_API ); inode =iget_locked (sb, ino);if (!inode) {
@@ -1413,10 +1415,8 @@ static struct inode *ll_iget_anon_dir(struct super_block *sb,return ERR_PTR (-ENOENT ); } + lli =ll_i2info (inode);if (inode->i_state &I_NEW ) { -struct ll_inode_info *lli =ll_i2info (inode); -struct lmv_stripe_md *lsm = md->lmv; - inode->i_mode = (inode->i_mode & ~S_IFMT ) | (body->mbo_mode &S_IFMT ); LASSERTF(S_ISDIR(inode->i_mode), "Not slave inode " DFID "\n",
@@ -1432,12 +1432,17 @@ static struct inode *ll_iget_anon_dir(struct super_block *sb, lli->lli_fid = *fid;ll_lli_init (lli); -LASSERT (lsm);/* master object FID */ lli->lli_pfid = body->mbo_fid1;CDEBUG (D_INODE ,"lli %p slave " DFID " master " DFID "\n" , lli,PFID (fid),PFID (&lli->lli_pfid));unlock_new_inode (inode); + }else { +/* in directory restripe/auto-split, a directory will be +* transformed to a stripe if it's plain, set its pfid here, +* otherwise ll_lock_cancel_bits() can't find the master inode. +*/ + lli->lli_pfid = body->mbo_fid1; }return inode;
@@ -1547,6 +1552,12 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md)if (md->default_lmv)ll_update_default_lsm_md (inode, md); +/* after dir migration/restripe, a stripe may be turned into a +* directory, in this case, zero out its lli_pfid. +*/ +if (unlikely (fid_is_norm (&lli->lli_pfid))) +fid_zero (&lli->lli_pfid); +/* * no striped information from request, lustre_md from req does not * include stripeEA, see ll_md_setattr()
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 16/18 lustre: llite: failed ASSERTION(ldlm_has_layout(lock))
In reply to James SimmonsFrom: Bobi Jam <[email protected]>
When setting layout in layout lock, the lock could lost its layout bits, and we'd try fetch the layout lock again.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14780
Lustre-commit: 1b166d6dd6a2f39d ("LU-14780 llite: failed ASSERTION(ldlm_has_layout(lock))")
Reviewed-on: https://review.whamcloud.com/44054
--- fs/lustre/llite/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/lustre/llite/file.c +5 -1
@@ -5609,7 +5609,11 @@ static int ll_layout_lock_set(struct lustre_handle *lockh, enum ldlm_mode mode, lock =ldlm_handle2lock (lockh);LASSERT (lock); -LASSERT (ldlm_has_layout (lock)); + +if (!ldlm_has_layout (lock)) { + rc = -EAGAIN ; + goto out; + }LDLM_DEBUG (lock,"File " DFID "(%p) being reconfigured" ,PFID (&lli->lli_fid), inode);
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 17/18 lustre: pcc: introducing OBD_CONNECT2_PCCRO flag
In reply to James SimmonsFrom: Qian Yingjin <[email protected]>
Add a new connection flag OBD_CONNECT2_PCCRO to solve the access consistency from the old client without PCC-RO support.
By necessity, also include definitions for OBD_CONNECT2_MODE_CONVERT and OBD_CONNECT2_BATCH_RPC so obd_connect_names[] works.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10499
Lustre-commit: 6007dc9382df726 ("LU-10499 pcc: introducing OBD_CONNECT2_PCCRO flag")
Reviewed-on: https://review.whamcloud.com/40791
--- fs/lustre/ptlrpc/wiretest.c | 6 ++++++ include/uapi/linux/lustre/lustre_idl.h | 4 ++++ 2 files changed, 10 insertions(+)
fs/lustre/ptlrpc/wiretest.c +6 -0
@@ -1252,6 +1252,12 @@ void lustre_assert_wire_constants(void) OBD_CONNECT2_DOM_LVB);LASSERTF (OBD_CONNECT2_REP_MBITS ==0x100000ULL ,"found 0x%.16llxULL\n" ,OBD_CONNECT2_REP_MBITS ); +LASSERTF (OBD_CONNECT2_MODE_CONVERT ==0x200000ULL ,"found 0x%.16llxULL\n" , +OBD_CONNECT2_MODE_CONVERT ); +LASSERTF (OBD_CONNECT2_BATCH_RPC ==0x400000ULL ,"found 0x%.16llxULL\n" , +OBD_CONNECT2_BATCH_RPC ); +LASSERTF (OBD_CONNECT2_PCCRO ==0x800000ULL ,"found 0x%.16llxULL\n" , +OBD_CONNECT2_PCCRO );LASSERTF (OBD_CONNECT2_ATOMIC_OPEN_LOCK ==0x4000000ULL ,"found 0x%.16llxULL\n" ,OBD_CONNECT2_ATOMIC_OPEN_LOCK ); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
include/uapi/linux/lustre/lustre_idl.h +4 -0
@@ -840,6 +840,10 @@ struct ptlrpc_body_v2 {#define OBD_CONNECT2_LSEEK 0x40000ULL/* SEEK_HOLE/DATA RPC */ #define OBD_CONNECT2_DOM_LVB 0x80000ULL/* pack DOM glimpse data in LVB */ #define OBD_CONNECT2_REP_MBITS 0x100000ULL/* match reply by mbits, not xid */ +#define OBD_CONNECT2_REP_MBITS 0x100000ULL/* match reply mbits not xid*/ +#define OBD_CONNECT2_MODE_CONVERT 0x200000ULL/* LDLM mode convert */ +#define OBD_CONNECT2_BATCH_RPC 0x400000ULL/* Multi-RPC batch request */ +#define OBD_CONNECT2_PCCRO 0x800000ULL/* Read-only PCC */ #define OBD_CONNECT2_ATOMIC_OPEN_LOCK 0x4000000ULL/* request lock on 1st open */ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
PATCH 18/18 lustre: sec: migrate/extend/split on encrypted file
In reply to James SimmonsFrom: Sebastien Buisson <[email protected]>
lfs migrate/extend/split makes use of volatile files to swap layouts. When operation is carried out on an encrypted file, the volatile file must be assigned the same encryption context as the original file, so that data moved/copied to different OSTs is identical to the original file's.
Also update sanity-sec test_52 to exercise these commands.
WC-bug-id: https://jira.whamcloud.com/browse/LU-14677
Lustre-commit: 09c558d16f0a80f4 ("LU-14677 sec: migrate/extend/split on encrypted file")
Reviewed-on: https://review.whamcloud.com/43878
--- fs/lustre/include/lustre_crypto.h | 2 + fs/lustre/llite/llite_lib.c | 6 +-- fs/lustre/llite/namei.c | 101 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 102 insertions(+), 7 deletions(-)
fs/lustre/include/lustre_crypto.h +2 -0
@@ -58,6 +58,8 @@ static inline bool ll_sbi_has_encrypt(struct ll_sb_info *sbi)static inline void ll_sbi_set_encrypt (struct ll_sb_info *sbi,bool set) { }#endif +/* sizeof(struct fscrypt_context_v2) = 40 */ +#define LLCRYPT_ENC_CTX_SIZE 40/* Encoding/decoding routines inspired from yEnc principles. * We just take care of a few critical characters:
fs/lustre/llite/llite_lib.c +3 -3
@@ -2063,8 +2063,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr,* it is necessary due to possible time * de-synchronization between MDT inode and OST objects */ -if (S_ISREG (inode->i_mode) &&IS_ENCRYPTED (inode) && - attr->ia_valid &ATTR_SIZE ) { +if (S_ISREG (inode->i_mode) &&IS_ENCRYPTED (inode)) { xvalid |=OP_XVALID_FLAGS ; flags =LUSTRE_ENCRYPT_FL ;/* Call to ll_io_zero_page is not necessary if
@@ -2073,7 +2072,8 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr,* In case of Direct IO, all we need is to set * new size. */ -if (attr->ia_size & ~PAGE_MASK && +if (attr->ia_valid &ATTR_SIZE && + attr->ia_size & ~PAGE_MASK && !(attr->ia_valid &ATTR_FILE && attr->ia_file->f_flags &O_DIRECT )) {pgoff_t offset;
fs/lustre/llite/namei.c +97 -4
113 lines not on this page · raw message
Signature · 6 lines
1.8.3.1 _______________________________________________ lustre-devel mailing list [email protected] http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org