lustre: backport OpenSFS work Dec 12, 2021
cover lustre: backport OpenSFS work Dec 12, 2021
Backport of the latest work on the OpenSFS branch as of Dec 12 2021
Andreas Dilger (1):
lustre: llite: avoid needless large stats alloc
Chris Horn (5):
lustre: ptlrpc: Do not unlink difficult reply until sent
lnet: Allow specifying a source NID for lnetctl ping
lnet: Fix source specified send to different net
lnet: Fix source specified to routed destination
lnet: o2iblnd: Default map_on_demand to 1
James Simmons (2):
lnet: uapi: move out kernel only code.
lustre: obdclass: make niduuid for lustre_stop_mgc() static
Qian Yingjin (1):
lustre: pcc: disable PCC for encrypted files
Sebastien Buisson (1):
lustre: llite: properly detect SELinux disabled case
Sergey Cheremencev (1):
lustre: obdclass: cosmetic changes in pool handling
Vladimir Saveliev (1):
lustre: llite: do not take mod rpc slot for getxattr
fs/lustre/include/lu_object.h | 2 +- fs/lustre/include/lustre_net.h | 3 +- fs/lustre/include/obd_support.h | 1 + fs/lustre/ldlm/ldlm_lib.c | 11 +- fs/lustre/llite/file.c | 3 + fs/lustre/llite/llite_internal.h | 7 +- fs/lustre/llite/llite_lib.c | 10 +- fs/lustre/llite/lproc_llite.c | 238 +++++++++++++++++++++-------- fs/lustre/llite/pcc.c | 3 + fs/lustre/llite/xattr_cache.c | 2 + fs/lustre/llite/xattr_security.c | 8 +- fs/lustre/mdc/mdc_locks.c | 2 +- fs/lustre/obdclass/lu_tgt_pool.c | 15 +- fs/lustre/obdclass/obd_mount.c | 25 +-- fs/lustre/ptlrpc/events.c | 19 ++- fs/lustre/ptlrpc/pack_generic.c | 2 +- fs/lustre/ptlrpc/service.c | 10 +- include/linux/lnet/lib-types.h | 16 ++ include/uapi/linux/lnet/lnet-dlc.h | 1 + include/uapi/linux/lnet/nidstr.h | 13 -- net/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 3 +- net/lnet/lnet/api-ni.c | 29 +++- net/lnet/lnet/lib-move.c | 28 ++-- 23 files changed, 302 insertions(+), 149 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/12 lustre: llite: do not take mod rpc slot for getxattr
From: Vladimir Saveliev <[email protected]>
The following scenario may lead to client eviction:
clientA clientB MDS
threadA1: write to file F1, get
and hold DoM MDC LDLM lock L1:
->cl_io_loop()
->cl_io_lock()
:
->mdc_lock_granted()
->lock->l_writers++
[hold ref until write done]threadA2-A8: create files F2-F8:
->ll_file_open()
->mdc_enqueue_base()
->ldlm_cli_enqueue()
->ptlrpc_get_mod_rpc_slot()
->ptlrpc_queue_wait()
[hold RPC slot until create done]
OST(s) in recovery. MDS waiting on OST(s) to precreate new objects.
threadA1:
-> cl_io_start()
-> __generic_file_aio_write()
-> file_remove_suid()
-> ll_xattr_cache_refill()
-> mdc_xattr_common()
-> ptlrpc_get_mod_rpc_slot()
[blocked waiting for RPC slot]
threadB1: write file F1,
enqueue DoM MDC lock L1
MDS sends blocking AST
to clientA for lock L1ldlm_threadA3: cannot cancel busy lock L1:
-> ldlm_handle_bl_callback()
["Lock L1 referenced, will be cancelled later"]
MDS evicts clientA for not cancelling lock L1
threadA1: never completes write:
->cl_io_end()
->cl_io_unlock()
->osc_lock_cancel()
->lock->l_writers--;The fix is to add IT_GETXATTR to list of operations which do not need mod rpc slot.
Tests to illustrate the issue is added.
wait_for_function(): total sleep time (wait) is to be equal to max when 1 is returned.
HPE-bug-id: LUS-7271
WC-bug-id: https://jira.whamcloud.com/browse/LU-12347
Lustre-commit: eb64594e4473af85 ("LU-12347 llite: do not take mod rpc slot for getxattr")
Reviewed-on: https://review.whamcloud.com/44151
--- fs/lustre/include/obd_support.h | 1 + fs/lustre/llite/xattr_cache.c | 2 ++ fs/lustre/mdc/mdc_locks.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-)
fs/lustre/include/obd_support.h +1 -0
@@ -484,6 +484,7 @@#define OBD_FAIL_LLITE_RACE_MOUNT 0x1417#define OBD_FAIL_LLITE_PAGE_ALLOC 0x1418#define OBD_FAIL_LLITE_OPEN_DELAY 0x1419 +#define OBD_FAIL_LLITE_XATTR_PAUSE 0x1420#define OBD_FAIL_FID_INDIR 0x1501#define OBD_FAIL_FID_INLMA 0x1502
fs/lustre/llite/xattr_cache.c +2 -0
@@ -396,6 +396,8 @@ static int ll_xattr_cache_refill(struct inode *inode)u32 *xsizes;int rc, i; +CFS_FAIL_TIMEOUT (OBD_FAIL_LLITE_XATTR_PAUSE , cfs_fail_val ?:2 ); + rc =ll_xattr_find_get_lock (inode, &oit, &req);if (rc) goto err_req;
fs/lustre/mdc/mdc_locks.c +1 -1
@@ -886,7 +886,7 @@ static inline bool mdc_skip_mod_rpc_slot(const struct lookup_intent *it) {if (it && (it->it_op ==IT_GETATTR || it->it_op ==IT_LOOKUP || - it->it_op ==IT_READDIR || + it->it_op ==IT_READDIR || it->it_op ==IT_GETXATTR || (it->it_op ==IT_LAYOUT && !(it->it_flags &MDS_FMODE_WRITE ))))return true;return false;
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/12 lnet: uapi: move out kernel only code.
In reply to James SimmonsUserland doesn't use the new IPv6 function in the UAPI nidstr.h. So move this to the kernel header lib-types.h. Normally this wouldn't matter but the python wrappers break with the LUTF project. With the move to Netlink in the future for the user land API we shouldn't need these functions anyways.
WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: 0631caae7d804720d ("LU-10391 uapi: move out kernel only code.")
Reviewed-on: https://review.whamcloud.com/44844
--- include/linux/lnet/lib-types.h | 16 ++++++++++++++++ include/uapi/linux/lnet/nidstr.h | 13 ------------- 2 files changed, 16 insertions(+), 13 deletions(-)
include/linux/lnet/lib-types.h +16 -0
@@ -51,6 +51,22 @@#include <uapi/linux/lnet/lnet-dlc.h> #include <uapi/linux/lnet/nidstr.h> +char *libcfs_nidstr_r (const struct lnet_nid *nid, +char *buf,size_t buf_size); + +static inline char *libcfs_nidstr (const struct lnet_nid *nid) +{ +return libcfs_nidstr_r (nid,libcfs_next_nidstring (), +LNET_NIDSTR_SIZE ); +} + +int libcfs_strnid (struct lnet_nid *nid,const char *str); +char *libcfs_idstr (struct lnet_processid *id); + +int cfs_match_nid_net (struct lnet_nid *nid,u32 net, +struct list_head *net_num_list, +struct list_head *addr); +/* Max payload size */ #define LNET_MAX_PAYLOAD LNET_MTU
include/uapi/linux/lnet/nidstr.h +0 -13
@@ -90,27 +90,14 @@ static inline char *libcfs_nid2str(lnet_nid_t nid) LNET_NIDSTR_SIZE); } -char *libcfs_nidstr_r (const struct lnet_nid *nid, -char *buf,__kernel_size_t buf_size); -static inline char *libcfs_nidstr (const struct lnet_nid *nid) -{ -return libcfs_nidstr_r (nid,libcfs_next_nidstring (), -LNET_NIDSTR_SIZE ); -} -__u32 libcfs_str2net (const char *str);lnet_nid_t libcfs_str2nid (const char *str); -int libcfs_strnid (struct lnet_nid *nid,const char *str);int libcfs_str2anynid (lnet_nid_t *nid,const char *str);char *libcfs_id2str (struct lnet_process_id id); -char *libcfs_idstr (struct lnet_processid *id);void cfs_free_nidlist (struct list_head *list);int cfs_parse_nidlist (char *str,int len,struct list_head *list);int cfs_print_nidlist (char *buffer,int count,struct list_head *list);int cfs_match_nid (lnet_nid_t nid,struct list_head *list); -int cfs_match_nid_net (struct lnet_nid *nid,__u32 net, -struct list_head *net_num_list, -struct list_head *addr);int cfs_match_net (__u32 net_id,__u32 net_type,struct list_head *net_num_list);
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/12 lustre: ptlrpc: Do not unlink difficult reply until sent
In reply to James SimmonsFrom: Chris Horn <[email protected]>
If a difficult reply is queued in LNet, or the PUT for it is otherwise delayed, then it is possible for the commit callback to unlink the reply MD which will abort the send. This results in client hitting "slow reply" timeout for the associated RPC and an unnecessary reconnect (and possibly resend).
This patch replaces the rs_on_net flag with rs_sent and rs_unlinked. These flags indicate whether the send event for the reply MD has been generated, and whether the MD has been unlinked, respectively.
If rs_sent is set, but rs_unlinked has not been set, then ptlrpc_hr is free to unlink the reply MD as a result of the commit callback. The reply-ack will simply be dropped by the server.
If ptlrpc_hr is processing the reply because of commit callback, and rs_sent has not been set, then ptlrpc_hr will not unlink the reply MD. This means that the reply_out_callback must also be modified to check for this case when the send event occurs. Otherwise, if the ACK never arrives from the client, then the MD would never be unlinked. Thus when the send event occurs, and rs_handled is set, the reply_out_callback will schedule the reply for handling by ptlrpc_hr.
HPE-bug-id: LUS-10505
WC-bug-id: https://jira.whamcloud.com/browse/LU-15068
Lustre-commit: 5c156b48425aae245 ("LU-15068 ptlrpc: Do not unlink difficult reply until sent")
Reviewed-on: https://review.whamcloud.com/45138
--- fs/lustre/include/lustre_net.h | 3 ++- fs/lustre/ldlm/ldlm_lib.c | 11 +++++++---- fs/lustre/ptlrpc/events.c | 19 ++++++++++++++++--- fs/lustre/ptlrpc/pack_generic.c | 2 +- fs/lustre/ptlrpc/service.c | 10 +++++++--- 5 files changed, 33 insertions(+), 12 deletions(-)
fs/lustre/include/lustre_net.h +2 -1
@@ -492,7 +492,8 @@ struct ptlrpc_reply_state { unsigned long rs_scheduled:1; /* being handled? */ unsigned long rs_scheduled_ever:1; /* any schedule attempts? */ unsigned long rs_handled:1; /* been handled yet? */ - unsigned long rs_on_net:1; /* reply_out_callback pending? */ + unsigned long rs_sent:1; /* Got LNET_EVENT_SEND? */ + unsigned long rs_unlinked:1; /* Reply MD unlinked? */ unsigned long rs_prealloc:1; /* rs from prealloc list */ unsigned long rs_committed:1; /* the transaction was committed* and the rs was dispatched
fs/lustre/ldlm/ldlm_lib.c +7 -4
@@ -813,7 +813,8 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)LASSERT (!rs->rs_scheduled);LASSERT (!rs->rs_scheduled_ever);LASSERT (!rs->rs_handled); -LASSERT (!rs->rs_on_net); +LASSERT (!rs->rs_sent); +LASSERT (!rs->rs_unlinked);LASSERT (!rs->rs_export);LASSERT (list_empty (&rs->rs_obd_list));LASSERT (list_empty (&rs->rs_exp_list));
@@ -822,7 +823,8 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)/* disable reply scheduling while I'm setting up */ rs->rs_scheduled =1 ; - rs->rs_on_net =1 ; + rs->rs_sent =0 ; + rs->rs_unlinked =0 ; rs->rs_xid = req->rq_xid; rs->rs_transno = req->rq_transno; rs->rs_export = exp;
@@ -856,13 +858,14 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id)* would have been +1 ref for the net, which * reply_out_callback leaves alone) */ - rs->rs_on_net =0 ; + rs->rs_sent =1 ; + rs->rs_unlinked =1 ;ptlrpc_rs_addref (rs); }spin_lock (&rs->rs_lock);if (rs->rs_transno <= exp->exp_last_committed || - (!rs->rs_on_net && !rs->rs_no_ack) || + (rs->rs_unlinked && !rs->rs_no_ack) ||list_empty (&rs->rs_exp_list) ||/* completed already */ list_empty (&rs->rs_obd_list)) {CDEBUG (D_HA ,"Schedule reply immediately\n" );
fs/lustre/ptlrpc/events.c +16 -3
@@ -401,6 +401,7 @@ void reply_out_callback(struct lnet_event *ev)struct ptlrpc_cb_id *cbid = ev->md_user_ptr;struct ptlrpc_reply_state *rs = cbid->cbid_arg;struct ptlrpc_service_part *svcpt = rs->rs_svcpt; +bool need_schedule = false; LASSERT(ev->type == LNET_EVENT_SEND || ev->type == LNET_EVENT_ACK ||
@@ -415,16 +416,28 @@ void reply_out_callback(struct lnet_event *ev)return ; } -LASSERT (rs->rs_on_net); +if (ev->type ==LNET_EVENT_SEND ) { +spin_lock (&rs->rs_lock); + rs->rs_sent =1 ; +/* If transaction was committed before the SEND, and the ACK +* is lost, then we need to schedule so ptlrpc_hr can unlink +* the MD. +*/ +if (rs->rs_handled) + need_schedule = true; +spin_unlock (&rs->rs_lock); + } + +if (ev->unlinked || need_schedule) { +LASSERT (rs->rs_sent); -if (ev->unlinked) {/* Last network callback. The net's ref on 'rs' stays put * until ptlrpc_handle_rs() is done with it */ spin_lock (&svcpt->scp_rep_lock);spin_lock (&rs->rs_lock); - rs->rs_on_net =0 ; + rs->rs_unlinked = ev->unlinked; if (!rs->rs_no_ack || rs->rs_transno <= rs->rs_export->exp_obd->obd_last_committed ||
fs/lustre/ptlrpc/pack_generic.c +1 -1
@@ -458,7 +458,7 @@ void lustre_free_reply_state(struct ptlrpc_reply_state *rs)LASSERT (atomic_read (&rs->rs_refcount) ==0 );LASSERT (!rs->rs_difficult || rs->rs_handled); -LASSERT (!rs->rs_on_net); +LASSERT (!rs->rs_difficult || rs->rs_unlinked);LASSERT (!rs->rs_scheduled);LASSERT (!rs->rs_export);LASSERT (rs->rs_nlocks ==0 );
fs/lustre/ptlrpc/service.c +7 -3
@@ -1940,10 +1940,14 @@ static int ptlrpc_handle_rs(struct ptlrpc_reply_state *rs) libcfs_nid2str(exp->exp_connection->c_peer.nid)); } -if ((!been_handled && rs->rs_on_net) || nlocks >0 ) { +if ((rs->rs_sent && !rs->rs_unlinked) || nlocks >0 ) {spin_unlock (&rs->rs_lock); -if (!been_handled && rs->rs_on_net) { +/* We can unlink if the LNET_EVENT_SEND has occurred. +* If rs_unlinked is set then MD is already unlinked and no +* need to do so here. +*/ +if ((rs->rs_sent && !rs->rs_unlinked)) {LNetMDUnlink (rs->rs_md_h);/* Ignore return code; we're racing with completion */ }
@@ -1957,7 +1961,7 @@ static int ptlrpc_handle_rs(struct ptlrpc_reply_state *rs) rs->rs_scheduled =0 ; -if (!rs->rs_on_net) { +if (rs->rs_unlinked) {/* Off the net */ spin_unlock (&rs->rs_lock);
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/12 lustre: obdclass: make niduuid for lustre_stop_mgc() static
In reply to James SimmonsThe process to create a proper string for niduuid can be made simpler and avoid a memory allocation.
WC-bug-id: https://jira.whamcloud.com/browse/LU-9325
Lustre-commit: 85b400b67b0d8d493 ("LU-9325 obdclass: make niduuid for lustre_stop_mgc() static")
Reviewed-on: https://review.whamcloud.com/33617
--- fs/lustre/obdclass/obd_mount.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-)
fs/lustre/obdclass/obd_mount.c +8 -17
@@ -431,8 +431,8 @@ static int lustre_stop_mgc(struct super_block *sb) {struct lustre_sb_info *lsi =s2lsi (sb);struct obd_device *obd; -char *niduuid =NULL , *ptr =NULL ; -int i, rc =0 , len =0 ; +char niduuid[MAX_OBD_NAME +6 ], *ptr =NULL ; +int i, rc =0 ;if (!lsi)return -ENOENT ;
@@ -467,24 +467,17 @@ static int lustre_stop_mgc(struct super_block *sb)CDEBUG (D_MOUNT ,"disconnect failed %d\n" , rc); } -/* Save the obdname for cleaning the nid uuids, which are obdname_XX */ - len =strlen (obd->obd_name) +6 ; - niduuid =kzalloc (len,GFP_NOFS ); -if (niduuid) { -strcpy (niduuid, obd->obd_name); - ptr = niduuid +strlen (niduuid); - } +/* +* Cache the obdname for cleaning the nid uuids, which are +* obdname_XX before calling class_manual_cleanup +*/ +strcpy (niduuid, obd->obd_name); + ptr = niduuid +strlen (niduuid); rc =class_manual_cleanup (obd);if (rc) goto out; -/* Clean the nid uuids */ -if (!niduuid) { - rc = -ENOMEM ; - goto out; - } -for (i =0 ; i < lsi->lsi_lmd->lmd_mgs_failnodes; i++) {sprintf (ptr,"_%x" , i); rc = do_lcfg(LUSTRE_MGC_OBDNAME, 0, LCFG_DEL_UUID,
@@ -494,8 +487,6 @@ static int lustre_stop_mgc(struct super_block *sb) niduuid, rc); } out: -kfree (niduuid); -/* class_import_put will get rid of the additional connections */ mutex_unlock (&mgc_start_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 5/12 lnet: Allow specifying a source NID for lnetctl ping
In reply to James SimmonsFrom: Chris Horn <[email protected]>
Add a new --source option for lnetctl ping command. This allows the user to specify a local NI from which to send the ping. This also ensures that the specified destination NID is also used. Otherwise, pings to multi-rail peers may end up going to a different peer NI based on the multi-rail selection algorithm. The ability to specify a source NI, and thus fix the destination NI, is a great help in troubleshooting communication issues between multi-rail peers.
Add test to exercise lnetctl ping --source option.
HPE-bug-id: LUS-10296
WC-bug-id: https://jira.whamcloud.com/browse/LU-14939
Lustre-commit: 48ef9982c474a02c4 ("LU-14939 lnet: Allow specifying a source NID for lnetctl ping")
Reviewed-on: https://review.whamcloud.com/44727
--- include/uapi/linux/lnet/lnet-dlc.h | 1 + net/lnet/lnet/api-ni.c | 29 ++++++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-)
include/uapi/linux/lnet/lnet-dlc.h +1 -0
@@ -132,6 +132,7 @@ struct lnet_ioctl_ping_data {__u32 mr_info;struct lnet_process_id ping_id;struct lnet_process_id __user *ping_buf; +lnet_nid_t ping_src; };struct lnet_ioctl_config_data {
net/lnet/lnet/api-ni.c +22 -7
@@ -205,8 +205,9 @@ static void lnet_set_lnd_timeout(void)*/ static atomic_t lnet_dlc_seq_no =ATOMIC_INIT (0 ); -static int lnet_ping (struct lnet_process_id id,signed long timeout, -struct lnet_process_id __user *ids,int n_ids); +static int lnet_ping (struct lnet_process_id id,lnet_nid_t src_nid, +signed long timeout,struct lnet_process_id __user *ids, +int n_ids);static int lnet_discover (struct lnet_process_id id,u32 force,struct lnet_process_id __user *ids,int n_ids);
@@ -4267,7 +4268,7 @@ u32 lnet_get_dlc_seq_locked(void)else timeout =msecs_to_jiffies (data->ioc_u32[1 ]); - rc =lnet_ping (id, timeout, data->ioc_pbuf1, + rc =lnet_ping (id,LNET_NID_ANY , timeout, data->ioc_pbuf1, data->ioc_plen1 /sizeof (struct lnet_process_id ));if (rc <0 )
@@ -4281,6 +4282,19 @@ u32 lnet_get_dlc_seq_locked(void)struct lnet_ioctl_ping_data *ping = arg;struct lnet_peer *lp;signed long timeout; +lnet_nid_t src_nid =LNET_NID_ANY ; + +/* Check if the supplied ping data supports source nid +* NB: This check is sufficient if lnet_ioctl_ping_data has +* additional fields added, but if they are re-ordered or +* fields removed then this will break. It is expected that +* these ioctls will be replaced with netlink implementation, so +* it is probably not worth coming up with a more robust version +* compatibility scheme. +*/ +if (ping->ping_hdr.ioc_len >= +sizeof (struct lnet_ioctl_ping_data )) + src_nid = ping->ping_src;/* If timeout is negative then set default of 3 minutes */ if (((s32)ping->op_param) <= 0 ||
@@ -4289,7 +4303,7 @@ u32 lnet_get_dlc_seq_locked(void)else timeout =msecs_to_jiffies (ping->op_param); - rc =lnet_ping (ping->ping_id, timeout, + rc =lnet_ping (ping->ping_id, src_nid, timeout, ping->ping_buf, ping->ping_count);if (rc <0 )
@@ -4526,8 +4540,9 @@ struct ping_data {complete (&pd->completion); } -static int lnet_ping (struct lnet_process_id id,signed long timeout, -struct lnet_process_id __user *ids,int n_ids) +static int lnet_ping (struct lnet_process_id id,lnet_nid_t src_nid, +signed long timeout,struct lnet_process_id __user *ids, +int n_ids) {struct lnet_md md = {NULL };struct ping_data pd = {0 };
@@ -4572,7 +4587,7 @@ static int lnet_ping(struct lnet_process_id id, signed long timeout, goto fail_ping_buffer_decref; } - rc =LNetGet (LNET_NID_ANY , pd.mdh, id, + rc =LNetGet (src_nid, pd.mdh, id,LNET_RESERVED_PORTAL ,LNET_PROTO_PING_MATCHBITS ,0 , false);if (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 6/12 lnet: Fix source specified send to different net
In reply to James SimmonsFrom: Chris Horn <[email protected]>
The destination NI is fixed for all source-specified sends. Thus, in order for a source-specified send to be considered "local", i.e. a send that does not require a route, the destination NID must be on the same net as the specified source.
HPE-bug-id: LUS-10303
WC-bug-id: https://jira.whamcloud.com/browse/LU-14940
Lustre-commit: 3e3563f719ce89de2 ("LU-14940 lnet: Fix source specified send to different net")
Reviewed-on: https://review.whamcloud.com/44728
--- net/lnet/lnet/lib-move.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
net/lnet/lnet/lib-move.c +11 -7
@@ -2733,15 +2733,19 @@ struct lnet_ni */* Identify the different send cases */ -if (src_nid ==LNET_NID_ANY ) +if (src_nid ==LNET_NID_ANY ) { send_case |=SRC_ANY ; -else +if (lnet_get_net_locked (LNET_NIDNET (dst_nid))) + send_case |=LOCAL_DST ; +else + send_case |=REMOTE_DST ; + }else { send_case |=SRC_SPEC ; - -if (lnet_get_net_locked (LNET_NIDNET (dst_nid))) - send_case |=LOCAL_DST ; -else - send_case |=REMOTE_DST ; +if (LNET_NIDNET (src_nid) ==LNET_NIDNET (dst_nid)) + send_case |=LOCAL_DST ; +else + send_case |=REMOTE_DST ; + } final_hop = false;if (msg->msg_routing && (send_case &LOCAL_DST ))
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/12 lnet: Fix source specified to routed destination
In reply to James SimmonsFrom: Chris Horn <[email protected]>
If a source NI is specified for a send then we should not modify the destination NID that was passed to lnet_send().
HPE-bug-id: LUS-10301
WC-bug-id: https://jira.whamcloud.com/browse/LU-14941
Lustre-commit: 98da4ace43a6c4c59 ("LU-14941 lnet: Fix source specified to routed destination")
Reviewed-on: https://review.whamcloud.com/44730
--- net/lnet/lnet/lib-move.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
net/lnet/lnet/lib-move.c +8 -2
@@ -1989,13 +1989,19 @@ struct lnet_ni * }if (!route_found) { -if (sd->sd_msg->msg_routing) { +if (sd->sd_msg->msg_routing || src_nid !=LNET_NID_ANY ) {/* If I'm routing this message then I need to find the * next hop based on the destination NID +* +* We also find next hop based on the destination NID +* if the source NI was specified */ best_rnet =lnet_find_rnet_locked (LNET_NIDNET (sd->sd_dst_nid));if (!best_rnet) { -CERROR ("Unable to route message to %s - Route table may be misconfigured\n" , +CERROR ("Unable to send message from %s to %s - Route table may be misconfigured\n" , + src_nid !=LNET_NID_ANY ? +libcfs_nid2str (src_nid) : +"any local NI" ,libcfs_nid2str (sd->sd_dst_nid));return -EHOSTUNREACH ; }
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/12 lustre: obdclass: cosmetic changes in pool handling
In reply to James SimmonsFrom: Sergey Cheremencev <[email protected]>
cosmetic changes in pool handling:
- make tgt_pool_free void
- set default rc value in lu_tgt_check_index.
HPE-bug-id: LUS-9547
WC-bug-id: https://jira.whamcloud.com/browse/LU-15110
Lustre-commit: d01cae3ec8758fc27 ("LU-15110 quota: cosmetic changes in PQ")
Reviewed-on: https://review.whamcloud.com/45258
--- fs/lustre/include/lu_object.h | 2 +- fs/lustre/obdclass/lu_tgt_pool.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-)
fs/lustre/include/lu_object.h +1 -1
@@ -1423,7 +1423,7 @@ struct lu_tgt_pool {int lu_tgt_pool_init (struct lu_tgt_pool *op,unsigned int count);int lu_tgt_pool_add (struct lu_tgt_pool *op,u32 idx,unsigned int min_count);int lu_tgt_pool_remove (struct lu_tgt_pool *op,u32 idx); -int lu_tgt_pool_free (struct lu_tgt_pool *op); +void lu_tgt_pool_free (struct lu_tgt_pool *op);int lu_tgt_check_index (int idx,struct lu_tgt_pool *osts);int lu_tgt_pool_extend (struct lu_tgt_pool *op,unsigned int min_count);
fs/lustre/obdclass/lu_tgt_pool.c +7 -8
@@ -197,14 +197,15 @@ int lu_tgt_pool_remove(struct lu_tgt_pool *op, u32 idx)int lu_tgt_check_index (int idx,struct lu_tgt_pool *osts) { -int rc =0 , i; +int i, rc = -ENOENT ;down_read (&osts->op_rw_sem);for (i =0 ; i < osts->op_count; i++) { -if (osts->op_array[i] == idx) +if (osts->op_array[i] == idx) { + rc =0 ; goto out; + } } - rc = -ENOENT ; out:up_read (&osts->op_rw_sem);return rc;
@@ -219,13 +220,11 @@ int lu_tgt_check_index(int idx, struct lu_tgt_pool *osts)* deleted from memory. * * @op pool to be freed. -* -* Return: 0 on success or if pool was already freed */ -int lu_tgt_pool_free (struct lu_tgt_pool *op) +void lu_tgt_pool_free (struct lu_tgt_pool *op) {if (op->op_size ==0 ) -return 0 ; +return ;down_write (&op->op_rw_sem);
@@ -235,6 +234,6 @@ int lu_tgt_pool_free(struct lu_tgt_pool *op) op->op_size =0 ;up_write (&op->op_rw_sem); -return 0 ; +return ; }EXPORT_SYMBOL (lu_tgt_pool_free);
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/12 lustre: llite: properly detect SELinux disabled case
In reply to James SimmonsFrom: Sebastien Buisson <[email protected]>
Usually, security_dentry_init_security() returns -EOPNOTSUPP when SELinux is disabled. But on some kernels it returns 0 when SELinux is disabled, and in this case the security context is empty. So in both cases make sure the security context name is not set, which means "SELinux is disabled" for the rest of the code.
WC-bug-id: https://jira.whamcloud.com/browse/LU-15184
Lustre-commit: 42661f7ba106b7d2e ("LU-15184 llite: properly detect SELinux disabled case")
Reviewed-on: https://review.whamcloud.com/45501
--- fs/lustre/llite/xattr_security.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/lustre/llite/xattr_security.c +7 -1
@@ -60,7 +60,13 @@ int ll_dentry_init_security(struct dentry *dentry, int mode, struct qstr *name, rc =security_dentry_init_security (dentry, mode, name, secctx, secctx_size); -if (rc == -EOPNOTSUPP ) +/* Usually, security_dentry_init_security() returns -EOPNOTSUPP when +* SELinux is disabled. +* But on some kernels (e.g. rhel 8.5) it returns 0 when SELinux is +* disabled, and in this case the security context is empty. +*/ +if (rc == -EOPNOTSUPP || (rc ==0 && *secctx_size ==0 )) +/* do nothing */ return 0 ;if (rc <0 )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 10/12 lnet: o2iblnd: Default map_on_demand to 1
In reply to James SimmonsFrom: Chris Horn <[email protected]>
On kernels that provide global MR we default to using that exclusively even if FMR/FastReg is available. This causes an interop issue if the active side of a connection request has a higher fragment count than the passive side because FMR/FastReg may be needed to map the higher fragment count. We should change the default map_on_demand to 1 so that FMR/FastReg is used by default. map_on)demand can still be set to 0 if needed.
WC-bug-id: https://jira.whamcloud.com/browse/LU-15186
Lustre-commit: 21fdd616bd4784e4e ("LU-15186 o2iblnd: Default map_on_demand to 1")
Reviewed-on: https://review.whamcloud.com/45431
--- net/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/lnet/klnds/o2iblnd/o2iblnd_modparams.c +1 -2
@@ -141,8 +141,7 @@* the behavior when transmit with GAPS verses contiguous. */ -#define IBLND_DEFAULT_MAP_ON_DEMAND 1 -static int map_on_demand =IBLND_DEFAULT_MAP_ON_DEMAND ; +static int map_on_demand =1 ;module_param (map_on_demand, int,0444 );MODULE_PARM_DESC (map_on_demand,"map on demand (obsolete)" );
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/12 lustre: pcc: disable PCC for encrypted files
In reply to James SimmonsFrom: Qian Yingjin <[email protected]>
When files are encrypted in Lustre using fscrypt, they should normally not be accessible to users without the proper encyrption key. However, if a user has then encryption key loaded when they read a file, it may be decrypted in memory and saved to the PCC backend in unencrypted form.
Due to the above reason, we just disable PCC caching for encrypted files.
DDN-bug-id: EX-3571
WC-bug-id: https://jira.whamcloud.com/browse/LU-15217
Lustre-commit: f8c79eea11ac96019 ("LU-15217 pcc: disable PCC for encrypted files")
Reviewed-on: https://review.whamcloud.com/45545
--- fs/lustre/llite/file.c | 3 +++ fs/lustre/llite/pcc.c | 3 +++ 2 files changed, 6 insertions(+)
fs/lustre/llite/file.c +3 -0
@@ -3598,6 +3598,9 @@ static long ll_file_unlock_lease(struct file *file, struct ll_ioc_lease *ioc,if (ioc->lil_count !=1 )return -EINVAL ; +if (IS_ENCRYPTED (inode)) +return -EOPNOTSUPP ; + arg +=sizeof (*ioc);if (copy_from_user (¶m.pa_archive_id, (void __user *)arg,sizeof (u32))) {
fs/lustre/llite/pcc.c +3 -0
@@ -1472,6 +1472,9 @@ int pcc_file_open(struct inode *inode, struct file *file)if (!S_ISREG (inode->i_mode))return 0 ; +if (IS_ENCRYPTED (inode)) +return 0 ; +pcc_inode_lock (inode); pcci =ll_i2pcci (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 12/12 lustre: llite: avoid needless large stats alloc
In reply to James SimmonsFrom: Andreas Dilger <[email protected]>
Allocate the ll_rw_extents_info (5896 bytes), ll_rw_offset_info (6400 bytes), and ll_rw_process_info (640 bytes) structs only when these stats are enabled, which is very rarely.
WC-bug-id: https://jira.whamcloud.com/browse/LU-15217
Lustre-commit: 9490fd9bb84dc277b ("LU-13601 llite: avoid needless large stats alloc")
Reviewed-on: https://review.whamcloud.com/40901
--- fs/lustre/llite/llite_internal.h | 7 +- fs/lustre/llite/llite_lib.c | 10 +- fs/lustre/llite/lproc_llite.c | 238 ++++++++++++++++++++++++++++----------- 3 files changed, 177 insertions(+), 78 deletions(-)
fs/lustre/llite/llite_internal.h +4 -3
@@ -701,12 +701,12 @@ struct ll_sb_info {struct cl_device *ll_cl;/* Statistics */ -struct ll_rw_extents_info ll_rw_extents_info; +struct ll_rw_extents_info *ll_rw_extents_info;int ll_extent_process_count;unsigned int ll_offset_process_count; +struct ll_rw_process_info *ll_rw_process_info; +struct ll_rw_process_info *ll_rw_offset_info;ktime_t ll_process_stats_init; -struct ll_rw_process_info ll_rw_process_info[LL_PROCESS_HIST_MAX ]; -struct ll_rw_process_info ll_rw_offset_info[LL_OFFSET_HIST_MAX ];unsigned int ll_rw_offset_entry_count;int ll_stats_track_id;enum stats_track_type ll_stats_track_type;
@@ -997,6 +997,7 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,void ll_rw_stats_tally (struct ll_sb_info *sbi,pid_t pid,struct ll_file_data *file,loff_t pos,size_t count,int rw); +void ll_free_rw_stats_info (struct ll_sb_info *sbi);enum {LPROC_LL_READ_BYTES ,
fs/lustre/llite/llite_lib.c +1 -9
@@ -85,7 +85,6 @@ static struct ll_sb_info *ll_init_sbi(void)unsigned long lru_page_max;struct sysinfo si;int rc; -int i; sbi =kzalloc (sizeof (*sbi),GFP_NOFS );if (!sbi)
@@ -161,14 +160,6 @@ static struct ll_sb_info *ll_init_sbi(void)set_bit (LL_SBI_LRU_RESIZE , sbi->ll_flags);set_bit (LL_SBI_LAZYSTATFS , sbi->ll_flags); -for (i =0 ; i <=LL_PROCESS_HIST_MAX ; i++) { -struct per_process_info *pp_ext; - - pp_ext = &sbi->ll_rw_extents_info.pp_extents[i]; -spin_lock_init (&pp_ext->pp_r_hist.oh_lock); -spin_lock_init (&pp_ext->pp_w_hist.oh_lock); - } -/* metadata statahead is enabled by default */ sbi->ll_sa_running_max =LL_SA_RUNNING_DEF ; sbi->ll_sa_max =LL_SA_RPC_DEF ;
@@ -241,6 +232,7 @@ static void ll_free_sbi(struct super_block *sb)kvfree (items); sbi->ll_foreign_symlink_upcall_items =NULL ; } +ll_free_rw_stats_info (sbi);pcc_super_fini (&sbi->ll_pcc_super);kfree (sbi); }
fs/lustre/llite/lproc_llite.c +172 -66
409 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