staging/lustre: sync with external tree, set 3
cover staging/lustre: sync with external tree, set 3
Hi Greg,
The first patch is a cleanup. The rest were ported from external tree. Please see if they can be merged.
Thanks,
Tao
Andreas Dilger (1):
staging/lustre/idl: remove LASSERT/CLASSERT from lustre_idl.h
Andriy Skulysh (1):
staging/lustre/ptlrpc: flock deadlock detection does not work
Artem Blagodarenko (2):
staging/lustre/mgs: set_param -P option that sets value permanently staging/lustre/obdclass: remove extra break in class_process_config
Doug Oucharek (1):
staging/lustre/lnet: Add LNet Router Priority parameter
JC Lafoucriere (2):
staging/lustre/api: HSM import uses new released pattern staging/lustre/lustre_user.h: remove obsolete comments
John L. Hammond (1):
staging/lustre/llite: pass correct pointer to obd_iocontrol()
Lai Siyao (2):
staging/lustre/llite: remove ll_d_root_ops staging/lustre/llite: don't d_add for create only files
Mikhail Pershin (2):
staging/lustre/target: move OUT to the unified target code staging/lustre/seq: remove seq_{query,handle}
Peng Tao (1):
staging/lustre: remove server macros from lustre_net.h
.../lustre/include/linux/libcfs/libcfs_ioctl.h | 1 + .../staging/lustre/include/linux/lnet/lib-lnet.h | 5 +- .../staging/lustre/include/linux/lnet/lib-types.h | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 5 +- drivers/staging/lustre/lnet/lnet/config.c | 39 +++- drivers/staging/lustre/lnet/lnet/lib-move.c | 6 + drivers/staging/lustre/lnet/lnet/router.c | 19 +- drivers/staging/lustre/lnet/lnet/router_proc.c | 16 +- .../lustre/lustre/include/lustre/lustre_idl.h | 48 +--- .../lustre/lustre/include/lustre/lustre_user.h | 23 +- drivers/staging/lustre/lustre/include/lustre_cfg.h | 2 + .../staging/lustre/lustre/include/lustre_disk.h | 2 + .../lustre/lustre/include/lustre_dlm_flags.h | 14 +- drivers/staging/lustre/lustre/include/lustre_fid.h | 6 - drivers/staging/lustre/lustre/include/lustre_net.h | 234 -------------------- drivers/staging/lustre/lustre/include/obd_class.h | 9 +- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 41 +++- drivers/staging/lustre/lustre/llite/dcache.c | 41 +--- drivers/staging/lustre/lustre/llite/dir.c | 23 +- drivers/staging/lustre/lustre/llite/file.c | 118 ++++++++-- .../staging/lustre/lustre/llite/llite_internal.h | 7 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 44 ++-- drivers/staging/lustre/lustre/llite/llite_nfs.c | 6 +- drivers/staging/lustre/lustre/llite/namei.c | 33 ++- drivers/staging/lustre/lustre/llite/statahead.c | 7 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 32 +-- drivers/staging/lustre/lustre/mgc/mgc_request.c | 90 ++++++-- .../lustre/lustre/obdclass/lprocfs_status.c | 1 + .../staging/lustre/lustre/obdclass/obd_config.c | 51 ++++- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 60 +++++ 30 files changed, 511 insertions(+), 474 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/13 staging/lustre: remove server macros from lustre_net.h
These macros are only used on server side.
--- drivers/staging/lustre/lustre/include/lustre_net.h | 234 -------------------- 1 file changed, 234 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +0 -234
@@ -264,241 +264,7 @@#define LDLM_MAXREQSIZE (5 * 1024)#define LDLM_MAXREPSIZE (1024) -/* -* MDS threads constants: -* -* Please see examples in "Thread Constants", MDS threads number will be at -* the comparable level of old versions, unless the server has many cores. -*/ -#ifndef MDS_MAX_THREADS -#define MDS_MAX_THREADS 1024 -#define MDS_MAX_OTHR_THREADS 256 - -#else /* MDS_MAX_THREADS */ -#if MDS_MAX_THREADS <PTLRPC_NTHRS_INIT -#undef MDS_MAX_THREADS -#define MDS_MAX_THREADS PTLRPC_NTHRS_INIT -#endif -#define MDS_MAX_OTHR_THREADS max(PTLRPC_NTHRS_INIT, MDS_MAX_THREADS / 2) -#endif - -/* default service */ -#define MDS_THR_FACTOR 8 -#define MDS_NTHRS_INIT PTLRPC_NTHRS_INIT -#define MDS_NTHRS_MAX MDS_MAX_THREADS -#define MDS_NTHRS_BASE min(64, MDS_NTHRS_MAX) - -/* read-page service */ -#define MDS_RDPG_THR_FACTOR 4 -#define MDS_RDPG_NTHRS_INIT PTLRPC_NTHRS_INIT -#define MDS_RDPG_NTHRS_MAX MDS_MAX_OTHR_THREADS -#define MDS_RDPG_NTHRS_BASE min(48, MDS_RDPG_NTHRS_MAX) - -/* these should be removed when we remove setattr service in the future */ -#define MDS_SETA_THR_FACTOR 4 -#define MDS_SETA_NTHRS_INIT PTLRPC_NTHRS_INIT -#define MDS_SETA_NTHRS_MAX MDS_MAX_OTHR_THREADS -#define MDS_SETA_NTHRS_BASE min(48, MDS_SETA_NTHRS_MAX) - -/* non-affinity threads */ -#define MDS_OTHR_NTHRS_INIT PTLRPC_NTHRS_INIT -#define MDS_OTHR_NTHRS_MAX MDS_MAX_OTHR_THREADS - -#define MDS_NBUFS 64 - -/** -* Assume file name length = FNAME_MAX = 256 (true for ext3). -* path name length = PATH_MAX = 4096 -* LOV MD size max = EA_MAX = 24 * 2000 -* (NB: 24 is size of lov_ost_data) -* LOV LOGCOOKIE size max = 32 * 2000 -* (NB: 32 is size of llog_cookie) -* symlink: FNAME_MAX + PATH_MAX <- largest -* link: FNAME_MAX + PATH_MAX (mds_rec_link < mds_rec_create) -* rename: FNAME_MAX + FNAME_MAX -* open: FNAME_MAX + EA_MAX -* -* MDS_MAXREQSIZE ~= 4736 bytes = -* lustre_msg + ldlm_request + mdt_body + mds_rec_create + FNAME_MAX + PATH_MAX -* MDS_MAXREPSIZE ~= 8300 bytes = lustre_msg + llog_header -* -* Realistic size is about 512 bytes (20 character name + 128 char symlink), -* except in the open case where there are a large number of OSTs in a LOV. -*/ -#define MDS_MAXREQSIZE (5 * 1024)/* >= 4736 */ -#define MDS_MAXREPSIZE (9 * 1024)/* >= 8300 */ - -/** -* MDS incoming request with LOV EA -* 24 = sizeof(struct lov_ost_data), i.e: replay of opencreate -*/ -#define MDS_LOV_MAXREQSIZE max(MDS_MAXREQSIZE, \ - 362 + LOV_MAX_STRIPE_COUNT * 24) -/** -* MDS outgoing reply with LOV EA -* -* NB: max reply size Lustre 2.4+ client can get from old MDS is: -* LOV_MAX_STRIPE_COUNT * (llog_cookie + lov_ost_data) + extra bytes -* -* but 2.4 or later MDS will never send reply with llog_cookie to any -* version client. This macro is defined for server side reply buffer size. -*/ -#define MDS_LOV_MAXREPSIZE MDS_LOV_MAXREQSIZE - -/** -* This is the size of a maximum REINT_SETXATTR request: -* -* lustre_msg 56 (32 + 4 x 5 + 4) -* ptlrpc_body 184 -* mdt_rec_setxattr 136 -* lustre_capa 120 -* name 256 (XATTR_NAME_MAX) -* value 65536 (XATTR_SIZE_MAX) -*/ -#define MDS_EA_MAXREQSIZE 66288 - -/** -* These are the maximum request and reply sizes (rounded up to 1 KB -* boundaries) for the "regular" MDS_REQUEST_PORTAL and MDS_REPLY_PORTAL. -*/ -#define MDS_REG_MAXREQSIZE (((max(MDS_EA_MAXREQSIZE, \ - MDS_LOV_MAXREQSIZE) + 1023) >> 10) << 10) -#define MDS_REG_MAXREPSIZE MDS_REG_MAXREQSIZE - -/** -* The update request includes all of updates from the create, which might -* include linkea (4K maxim), together with other updates, we set it to 9K: -* lustre_msg + ptlrpc_body + UPDATE_BUF_SIZE (8K) -*/ -#define MDS_OUT_MAXREQSIZE (9 * 1024) -#define MDS_OUT_MAXREPSIZE MDS_MAXREPSIZE - -/** MDS_BUFSIZE = max_reqsize (w/o LOV EA) + max sptlrpc payload size */ -#define MDS_BUFSIZE max(MDS_MAXREQSIZE + SPTLRPC_MAX_PAYLOAD, \ - 8 * 1024) - -/** -* MDS_REG_BUFSIZE should at least be MDS_REG_MAXREQSIZE + SPTLRPC_MAX_PAYLOAD. -* However, we need to allocate a much larger buffer for it because LNet -* requires each MD(rqbd) has at least MDS_REQ_MAXREQSIZE bytes left to avoid -* dropping of maximum-sized incoming request. So if MDS_REG_BUFSIZE is only a -* little larger than MDS_REG_MAXREQSIZE, then it can only fit in one request -* even there are about MDS_REG_MAX_REQSIZE bytes left in a rqbd, and memory -* utilization is very low. -* -* In the meanwhile, size of rqbd can't be too large, because rqbd can't be -* reused until all requests fit in it have been processed and released, -* which means one long blocked request can prevent the rqbd be reused. -* Now we set request buffer size to 160 KB, so even each rqbd is unlinked -* from LNet with unused 65 KB, buffer utilization will be about 59%. -* Please check LU-2432 for details. -*/ -#define MDS_REG_BUFSIZE max(MDS_REG_MAXREQSIZE + SPTLRPC_MAX_PAYLOAD, \ - 160 * 1024) - -/** -* MDS_OUT_BUFSIZE = max_out_reqsize + max sptlrpc payload (~1K) which is -* about 10K, for the same reason as MDS_REG_BUFSIZE, we also give some -* extra bytes to each request buffer to improve buffer utilization rate. -*/ -#define MDS_OUT_BUFSIZE max(MDS_OUT_MAXREQSIZE + SPTLRPC_MAX_PAYLOAD, \ - 24 * 1024) - -/** FLD_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc */ -#define FLD_MAXREQSIZE (160) - -/** FLD_MAXREPSIZE == lustre_msg + ptlrpc_body */ -#define FLD_MAXREPSIZE (152) -#define FLD_BUFSIZE (1 << 12) - -/** -* SEQ_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc + lu_range + -* __u32 padding */ -#define SEQ_MAXREQSIZE (160) - -/** SEQ_MAXREPSIZE == lustre_msg + ptlrpc_body + lu_range */ -#define SEQ_MAXREPSIZE (152) -#define SEQ_BUFSIZE (1 << 12) - -/** MGS threads must be >= 3, see bug 22458 comment #28 */ -#define MGS_NTHRS_INIT (PTLRPC_NTHRS_INIT + 1) -#define MGS_NTHRS_MAX 32 - -#define MGS_NBUFS 64 -#define MGS_BUFSIZE (8 * 1024) -#define MGS_MAXREQSIZE (7 * 1024) -#define MGS_MAXREPSIZE (9 * 1024) - -/* -* OSS threads constants: -* -* Given 8 as factor and 64 as base threads number -* -* example 1): -* On 8-core server configured to 2 partitions, we will have -* 64 + 8 * 4 = 96 threads for each partition, 192 total threads. -* -* example 2): -* On 32-core machine configured to 4 partitions, we will have -* 64 + 8 * 8 = 112 threads for each partition, so total threads number -* will be 112 * 4 = 448. -* -* example 3): -* On 64-core machine configured to 4 partitions, we will have -* 64 + 16 * 8 = 192 threads for each partition, so total threads number -* will be 192 * 4 = 768 which is above limit OSS_NTHRS_MAX(512), so we -* cut off the value to OSS_NTHRS_MAX(512) / 4 which is 128 threads -* for each partition. -* -* So we can see that with these constants, threads number wil be at the -* similar level of old versions, unless the server has many cores. -*/ -/* depress threads factor for VM with small memory size */ -#define OSS_THR_FACTOR min_t(int, 8, \ - NUM_CACHEPAGES >> (28 - PAGE_CACHE_SHIFT)) -#define OSS_NTHRS_INIT (PTLRPC_NTHRS_INIT + 1) -#define OSS_NTHRS_BASE 64 -#define OSS_NTHRS_MAX 512 - -/* threads for handling "create" request */ -#define OSS_CR_THR_FACTOR 1 -#define OSS_CR_NTHRS_INIT PTLRPC_NTHRS_INIT -#define OSS_CR_NTHRS_BASE 8 -#define OSS_CR_NTHRS_MAX 64 - -/** -* OST_IO_MAXREQSIZE ~= -* lustre_msg + ptlrpc_body + obdo + obd_ioobj + -* DT_MAX_BRW_PAGES * niobuf_remote -* -* - single object with 16 pages is 512 bytes -* - OST_IO_MAXREQSIZE must be at least 1 page of cookies plus some spillover -* - Must be a multiple of 1024 -* - actual size is about 18K -*/ -#define _OST_MAXREQSIZE_SUM (sizeof(struct lustre_msg) + \ - sizeof(struct ptlrpc_body) + \ - sizeof(struct obdo) + \ - sizeof(struct obd_ioobj) + \ - sizeof(struct niobuf_remote) * DT_MAX_BRW_PAGES) -/** -* FIEMAP request can be 4K+ for now -*/ #define OST_MAXREQSIZE (5 * 1024) -#define OST_IO_MAXREQSIZE max_t(int, OST_MAXREQSIZE, \ - (((_OST_MAXREQSIZE_SUM - 1) | (1024 - 1)) + 1)) - -#define OST_MAXREPSIZE (9 * 1024) -#define OST_IO_MAXREPSIZE OST_MAXREPSIZE - -#define OST_NBUFS 64 -/** OST_BUFSIZE = max_reqsize + max sptlrpc payload size */ -#define OST_BUFSIZE max_t(int, OST_MAXREQSIZE + 1024, 16 * 1024) -/** -* OST_IO_MAXREQSIZE is 18K, giving extra 46K can increase buffer utilization -* rate of request buffer, please check comment of MDS_LOV_BUFSIZE for details. -*/ -#define OST_IO_BUFSIZE max_t(int, OST_IO_MAXREQSIZE + 1024, 64 * 1024)/* Macro to hide a typecast. */ #define ptlrpc_req_async_args (req) ((void *)&req->rq_async_args)
Signature · 1 line
1.7.9.5
PATCH 2/13 staging/lustre/lnet: Add LNet Router Priority parameter
In reply to Peng TaoFrom: Doug Oucharek <[email protected]>
This change adds a priority parameter to the route module settings. This paramter can be >= 0. Like hops, the lower the prioirty number the higher the priority. So lower numbered priorities will be selected over higher numbers.
Lustre-change: http://review.whamcloud.com/5663
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2934
--- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 1 + .../staging/lustre/include/linux/lnet/lib-lnet.h | 5 ++- .../staging/lustre/include/linux/lnet/lib-types.h | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 5 ++- drivers/staging/lustre/lnet/lnet/config.c | 39 +++++++++++++++++++- drivers/staging/lustre/lnet/lnet/lib-move.c | 6 +++ drivers/staging/lustre/lnet/lnet/router.c | 19 ++++++---- drivers/staging/lustre/lnet/lnet/router_proc.c | 16 ++++---- 8 files changed, 72 insertions(+), 21 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +1 -0
@@ -69,6 +69,7 @@ struct libcfs_ioctl_data {char ioc_bulk[0 ]; }; +#define ioc_priority ioc_u32[0]struct libcfs_ioctl_hdr {__u32 ioc_len;
drivers/staging/lustre/include/linux/lnet/lib-lnet.h +3 -2
@@ -650,12 +650,13 @@ extern lnet_ni_t *lnet_net2ni(__u32 net);int lnet_notify (lnet_ni_t *ni,lnet_nid_t peer,int alive,cfs_time_t when);void lnet_notify_locked (lnet_peer_t *lp,int notifylnd,int alive,cfs_time_t when); -int lnet_add_route (__u32 net,unsigned int hops,lnet_nid_t gateway_nid); +int lnet_add_route (__u32 net,unsigned int hops,lnet_nid_t gateway_nid, +unsigned int priority);int lnet_check_routes (void );int lnet_del_route (__u32 net,lnet_nid_t gw_nid);void lnet_destroy_routes (void );int lnet_get_route (int idx,__u32 *net,__u32 *hops, -lnet_nid_t *gateway,__u32 *alive); +lnet_nid_t *gateway,__u32 *alive,__u32 *priority);void lnet_proc_init (void );void lnet_proc_fini (void );int lnet_rtrpools_alloc (int im_a_router);
drivers/staging/lustre/include/linux/lnet/lib-types.h +1 -1
@@ -478,7 +478,6 @@ typedef struct lnet_peer {lnet_rc_data_t *lp_rcd;/* router checker state */ } lnet_peer_t; -/* peer hash size */ #define LNET_PEER_HASH_BITS 9#define LNET_PEER_HASH_SIZE (1 << LNET_PEER_HASH_BITS)
@@ -504,6 +503,7 @@ typedef struct {int lr_seq;/* sequence for round-robin */ unsigned int lr_downis;/* number of down NIs */ unsigned int lr_hops;/* how far I am */ +unsigned int lr_priority;/* route priority */ } lnet_route_t;#define LNET_REMOTE_NETS_HASH_DEFAULT (1U << 7)
drivers/staging/lustre/lnet/lnet/api-ni.c +3 -2
@@ -1436,7 +1436,7 @@ LNetCtl(unsigned int cmd, void *arg)case IOC_LIBCFS_ADD_ROUTE : rc =lnet_add_route (data->ioc_net, data->ioc_count, - data->ioc_nid); + data->ioc_nid, data->ioc_priority);return (rc !=0 ) ? rc :lnet_check_routes ();case IOC_LIBCFS_DEL_ROUTE :
@@ -1445,7 +1445,8 @@ LNetCtl(unsigned int cmd, void *arg)case IOC_LIBCFS_GET_ROUTE :return lnet_get_route (data->ioc_count, &data->ioc_net, &data->ioc_count, - &data->ioc_nid, &data->ioc_flags); + &data->ioc_nid, &data->ioc_flags, + &data->ioc_priority);case IOC_LIBCFS_NOTIFY_ROUTER : return lnet_notify(NULL, data->ioc_nid, data->ioc_flags, cfs_time_current() -
drivers/staging/lustre/lnet/lnet/config.c +38 -1
@@ -603,6 +603,37 @@ lnet_parse_hops(char *str, unsigned int *hops) *hops > 0 && *hops < 256); } +#define LNET_PRIORITY_SEPARATOR (':') + +int +lnet_parse_priority (char *str,unsigned int *priority,char **token) +{ +int nob; +char *sep; +int len; + + sep =strchr (str,LNET_PRIORITY_SEPARATOR ); +if (sep ==NULL ) { + *priority =0 ; +return 0 ; + } + len =strlen (sep +1 ); + +if ((sscanf ((sep+1 ),"%u%n" , priority, &nob) <1 ) || (len != nob)) { +/* Update the caller's token pointer so it treats the found +priority as the token to report in the error message. */ + *token += sep - str +1 ; +return -1 ; + } + +CDEBUG (D_NET ,"gateway %s, priority %d, nob %d\n" , str, *priority, nob); + +/* +* Change priority separator to \0 to be able to parse NID +*/ + *sep ='\0' ; +return 0 ; +}int lnet_parse_route (char *str,int *im_a_router)
@@ -624,6 +655,7 @@ lnet_parse_route(char *str, int *im_a_router)int myrc =-1 ;unsigned int hops;int got_hops =0 ; +unsigned int priority =0 ;INIT_LIST_HEAD (&gateways);INIT_LIST_HEAD (&nets);
@@ -691,6 +723,11 @@ lnet_parse_route(char *str, int *im_a_router) LNET_NETTYP(net) == LOLND) goto token_error; }else { + rc =lnet_parse_priority (ltb->ltb_text, + &priority, &token); +if (rc <0 ) + goto token_error; + nid =libcfs_str2nid (ltb->ltb_text);if (nid ==LNET_NID_ANY ||LNET_NETTYP (LNET_NIDNET (nid)) ==LOLND )
@@ -720,7 +757,7 @@ lnet_parse_route(char *str, int *im_a_router)continue ; } - rc =lnet_add_route (net, hops, nid); + rc =lnet_add_route (net, hops, nid, priority);if (rc !=0 ) { CERROR("Can't create route to %s via %s\n", libcfs_net2str(net),
drivers/staging/lustre/lnet/lnet/lib-move.c +6 -0
@@ -1074,6 +1074,12 @@ lnet_compare_routes(lnet_route_t *r1, lnet_route_t *r2)lnet_peer_t *p1 = r1->lr_gateway;lnet_peer_t *p2 = r2->lr_gateway; +if (r1->lr_priority < r2->lr_priority) +return 1 ; + +if (r1->lr_priority > r2->lr_priority) +return -1 ; +if (r1->lr_hops < r2->lr_hops)return 1 ;
drivers/staging/lustre/lnet/lnet/router.c +11 -8
@@ -301,7 +301,8 @@ lnet_add_route_to_rnet (lnet_remotenet_t *rnet, lnet_route_t *route) }int -lnet_add_route (__u32 net,unsigned int hops,lnet_nid_t gateway) +lnet_add_route (__u32 net,unsigned int hops,lnet_nid_t gateway, +unsigned int priority) {struct list_head *e;lnet_remotenet_t *rnet;
@@ -311,8 +312,8 @@ lnet_add_route (__u32 net, unsigned int hops, lnet_nid_t gateway)int add_route;int rc; -CDEBUG (D_NET ,"Add route: net %s hops %u gw %s\n" , -libcfs_net2str (net), hops,libcfs_nid2str (gateway)); +CDEBUG (D_NET ,"Add route: net %s hops %u priority %u gw %s\n" , +libcfs_net2str (net), hops, priority,libcfs_nid2str (gateway)); if (gateway == LNET_NID_ANY || LNET_NETTYP(LNET_NIDNET(gateway)) == LOLND ||
@@ -342,6 +343,7 @@ lnet_add_route (__u32 net, unsigned int hops, lnet_nid_t gateway) rnet->lrn_net = net; route->lr_hops = hops; route->lr_net = net; + route->lr_priority = priority;lnet_net_lock (LNET_LOCK_EX );
@@ -552,7 +554,7 @@ lnet_destroy_routes (void)int lnet_get_route (int idx,__u32 *net,__u32 *hops, -lnet_nid_t *gateway,__u32 *alive) +lnet_nid_t *gateway,__u32 *alive,__u32 *priority) {struct list_head *e1;struct list_head *e2;
@@ -574,10 +576,11 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops, lr_list);if (idx-- ==0 ) { - *net = rnet->lrn_net; - *hops = route->lr_hops; - *gateway = route->lr_gateway->lp_nid; - *alive = route->lr_gateway->lp_alive; + *net = rnet->lrn_net; + *hops = route->lr_hops; + *priority = route->lr_priority; + *gateway = route->lr_gateway->lp_nid; + *alive = route->lr_gateway->lp_alive;lnet_net_unlock (cpt);return 0 ; }
drivers/staging/lustre/lnet/lnet/router_proc.c +9 -7
@@ -174,8 +174,8 @@ int LL_PROC_PROTO(proc_lnet_routes) the_lnet.ln_routing ? "enabled" : "disabled");LASSERT (tmpstr + tmpsiz - s >0 ); - s +=snprintf (s, tmpstr + tmpsiz - s,"%-8s %4s %7s %s\n" , -"net" ,"hops" ,"state" ,"router" ); + s +=snprintf (s, tmpstr + tmpsiz - s,"%-8s %4s %8s %7s %s\n" , +"net" ,"hops" ,"priority" ,"state" ,"router" );LASSERT (tmpstr + tmpsiz - s >0 );lnet_net_lock (0 );
@@ -229,14 +229,16 @@ int LL_PROC_PROTO(proc_lnet_routes) }if (route !=NULL ) { -__u32 net = rnet->lrn_net; -unsigned int hops = route->lr_hops; -lnet_nid_t nid = route->lr_gateway->lp_nid; -int alive = route->lr_gateway->lp_alive; +__u32 net = rnet->lrn_net; +unsigned int hops = route->lr_hops; +unsigned int priority = route->lr_priority; +lnet_nid_t nid = route->lr_gateway->lp_nid; +int alive = route->lr_gateway->lp_alive; s +=snprintf (s, tmpstr + tmpsiz - s, -"%-8s %4u %7s %s\n" , +"%-8s %4u %8u %7s %s\n" ,libcfs_net2str (net), hops, + priority, alive ?"up" :"down" ,libcfs_nid2str (nid));LASSERT (tmpstr + tmpsiz - s >0 );
Signature · 1 line
1.7.9.5
PATCH 4/13 staging/lustre/target: move OUT to the unified target code
In reply to Peng TaoFrom: Mikhail Pershin <[email protected]>
- Move OUT handler to the unified target code, so it can be used by both MDS and OST.
Lustre-change: http://review.whamcloud.com/6763
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3467
--- drivers/staging/lustre/lustre/mdc/mdc_request.c | 32 +---------------------- 1 file changed, 1 insertion(+), 31 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_request.c +1 -31
@@ -2076,15 +2076,6 @@ int mdc_set_info_async(const struct lu_env *env,sptlrpc_import_flush_my_ctx (imp);return 0 ; } -if (KEY_IS (KEY_MDS_CONN )) { -/* mds-mds import */ -spin_lock (&imp->imp_lock); - imp->imp_server_timeout =1 ; -spin_unlock (&imp->imp_lock); - imp->imp_client->cli_request_portal =MDS_MDS_PORTAL ; -CDEBUG (D_OTHER ,"%s: timeout / 2\n" , exp->exp_obd->obd_name); -return 0 ; - }if (KEY_IS (KEY_CHANGELOG_CLEAR )) { rc =do_set_info_async (imp,MDS_SET_INFO ,LUSTRE_MDS_VERSION , keylen, key, vallen, val, set);
@@ -2594,27 +2585,6 @@ static int mdc_renew_capa(struct obd_export *exp, struct obd_capa *oc,return 0 ; } -static int mdc_connect (const struct lu_env *env, -struct obd_export **exp, -struct obd_device *obd,struct obd_uuid *cluuid, -struct obd_connect_data *data, -void *localdata) -{ -struct obd_import *imp = obd->u.cli.cl_import; - -/* mds-mds import features */ -if (data && (data->ocd_connect_flags &OBD_CONNECT_MDS_MDS )) { -spin_lock (&imp->imp_lock); - imp->imp_server_timeout =1 ; -spin_unlock (&imp->imp_lock); - imp->imp_client->cli_request_portal =MDS_MDS_PORTAL ; -CDEBUG (D_OTHER ,"%s: Set 'mds' portal and timeout\n" , - obd->obd_name); - } - -return client_connect_import (env, exp, obd, cluuid, data,NULL ); -} -struct obd_ops mdc_obd_ops = { .o_owner =THIS_MODULE , .o_setup = mdc_setup,
@@ -2622,7 +2592,7 @@ struct obd_ops mdc_obd_ops = { .o_cleanup = mdc_cleanup, .o_add_conn = client_import_add_conn, .o_del_conn = client_import_del_conn, - .o_connect = mdc_connect, + .o_connect = client_connect_import, .o_disconnect = client_disconnect_export, .o_iocontrol = mdc_iocontrol, .o_set_info_async = mdc_set_info_async,
Signature · 1 line
1.7.9.5
PATCH 5/13 staging/lustre/seq: remove seq_{query,handle}
In reply to Peng TaoFrom: Mikhail Pershin <[email protected]>
This is only part of the original Lustre tree commit. Main part of the original commit modifies server side code.
Lustre-change: http://review.whamcloud.com/6765
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3467
--- drivers/staging/lustre/lustre/include/lustre_fid.h | 6 ------ 1 file changed, 6 deletions(-)
drivers/staging/lustre/lustre/include/lustre_fid.h +0 -6
@@ -431,12 +431,6 @@ struct lu_server_seq {struct seq_server_site *lss_site; }; -struct com_thread_info ; -int seq_query (struct com_thread_info *info); - -struct ptlrpc_request ; -int seq_handle (struct ptlrpc_request *req); -/* Server methods */ int seq_server_init(struct lu_server_seq *seq,
Signature · 1 line
1.7.9.5
PATCH 7/13 staging/lustre/llite: don't d_add for create only files
In reply to Peng TaoFrom: Lai Siyao <[email protected]>
This is only part of the original Lustre commit. Splitted to remove d_add() for create only files, because the dentry is fake, and will be released right after use.
Lustre-change: http://review.whamcloud.com/6797
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3486
--- drivers/staging/lustre/lustre/llite/namei.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/staging/lustre/lustre/llite/namei.c +1 -5
@@ -583,12 +583,8 @@ static struct dentry *ll_lookup_nd(struct inode *parent, struct dentry *dentry, parent->i_generation, parent, flags);/* Optimize away (CREATE && !OPEN). Let .create handle the race. */ -if ((flags &LOOKUP_CREATE ) && !(flags &LOOKUP_OPEN )) { -ll_dops_init (dentry,1 ,1 ); -__d_lustre_invalidate (dentry); -d_add (dentry,NULL ); +if ((flags &LOOKUP_CREATE ) && !(flags &LOOKUP_OPEN ))return NULL ; - }if (flags & (LOOKUP_PARENT |LOOKUP_OPEN |LOOKUP_CREATE )) itp =NULL ;
Signature · 1 line
1.7.9.5
PATCH 9/13 staging/lustre/idl: remove LASSERT/CLASSERT from lustre_idl.h
In reply to Peng TaoFrom: Andreas Dilger <[email protected]>
Remove the usage of LASSERT() and CLASSERT() from lustre_idl.h, so that it is usable from userspace programs if needed. These have crept in over the years, but are not intended to be there.
The CLASSERT() checks for fid swabbing were largely redundant, and have been moved to lustre/fid/fid_handler.c.
There are still a few LASSERTs that need to be removed when FID-on-OST is landed, but I don't want to remove them before that code lands.
There are also uses of CERROR() that could be removed at that time.
Lustre-change: http://review.whamcloud.com/5682
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1606
--- .../lustre/lustre/include/lustre/lustre_idl.h | 43 ++++---------------- 1 file changed, 8 insertions(+), 35 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +8 -35
@@ -91,8 +91,8 @@#ifndef _LUSTRE_IDL_H_#define _LUSTRE_IDL_H_ -#if !defined(LASSERT ) && !defined(LPU64 ) -#include <linux/libcfs/libcfs.h> /* for LASSERT, LPUX64, etc */ +#if !defined(LPU64 ) +#include <linux/libcfs/libcfs.h> /* for LPUX64, etc */ #endif /* Defn's shared with user-space. */
@@ -232,7 +232,6 @@ static inline unsigned fld_range_is_any(const struct lu_seq_range *range)static inline void fld_range_set_type (struct lu_seq_range *range,unsigned flags) { -LASSERT (!(flags & ~LU_SEQ_RANGE_MASK )); range->lsr_flags |= flags; }
@@ -615,7 +614,6 @@ static inline obd_id fid_idif_id(obd_seq seq, __u32 oid, __u32 ver)/* extract ost index from IDIF FID */ static inline __u32 fid_idif_ost_idx (const struct lu_fid *fid) { -LASSERT (fid_is_idif (fid));return (fid_seq (fid) >>16 ) &0xffff ; }
@@ -833,11 +831,6 @@ static inline void lu_igif_build(struct lu_fid *fid, __u32 ino, __u32 gen)*/ static inline void fid_cpu_to_le (struct lu_fid *dst,const struct lu_fid *src) { -/* check that all fields are converted */ -CLASSERT (sizeof (*src) == -sizeof (fid_seq (src)) + -sizeof (fid_oid (src)) + -sizeof (fid_ver (src))); dst->f_seq =cpu_to_le64 (fid_seq (src)); dst->f_oid =cpu_to_le32 (fid_oid (src)); dst->f_ver =cpu_to_le32 (fid_ver (src));
@@ -845,11 +838,6 @@ static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src)static inline void fid_le_to_cpu (struct lu_fid *dst,const struct lu_fid *src) { -/* check that all fields are converted */ -CLASSERT (sizeof (*src) == -sizeof (fid_seq (src)) + -sizeof (fid_oid (src)) + -sizeof (fid_ver (src))); dst->f_seq =le64_to_cpu (fid_seq (src)); dst->f_oid =le32_to_cpu (fid_oid (src)); dst->f_ver =le32_to_cpu (fid_ver (src));
@@ -857,11 +845,6 @@ static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src)static inline void fid_cpu_to_be (struct lu_fid *dst,const struct lu_fid *src) { -/* check that all fields are converted */ -CLASSERT (sizeof (*src) == -sizeof (fid_seq (src)) + -sizeof (fid_oid (src)) + -sizeof (fid_ver (src))); dst->f_seq =cpu_to_be64 (fid_seq (src)); dst->f_oid =cpu_to_be32 (fid_oid (src)); dst->f_ver =cpu_to_be32 (fid_ver (src));
@@ -869,11 +852,6 @@ static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src)static inline void fid_be_to_cpu (struct lu_fid *dst,const struct lu_fid *src) { -/* check that all fields are converted */ -CLASSERT (sizeof (*src) == -sizeof (fid_seq (src)) + -sizeof (fid_oid (src)) + -sizeof (fid_ver (src))); dst->f_seq =be64_to_cpu (fid_seq (src)); dst->f_oid =be32_to_cpu (fid_oid (src)); dst->f_ver =be32_to_cpu (fid_ver (src));
@@ -897,11 +875,6 @@ extern void lustre_swab_lu_seq_range(struct lu_seq_range *range);static inline int lu_fid_eq (const struct lu_fid *f0,const struct lu_fid *f1) { -/* Check that there is no alignment padding. */ -CLASSERT (sizeof (*f0) == -sizeof (f0->f_seq) + -sizeof (f0->f_oid) + -sizeof (f0->f_ver));return memcmp (f0, f1,sizeof (*f0)) ==0 ; }
@@ -3328,9 +3301,10 @@ struct obdo {#define o_grant_used o_data_versionstatic inline void lustre_set_wire_obdo (struct obd_connect_data *ocd, -struct obdo *wobdo,struct obdo *lobdo) +struct obdo *wobdo, +const struct obdo *lobdo) { -memcpy (wobdo, lobdo,sizeof (*lobdo)); + *wobdo = *lobdo; wobdo->o_flags &= ~OBD_FL_LOCAL_MASK ;if (ocd ==NULL )return ;
@@ -3345,16 +3319,15 @@ static inline void lustre_set_wire_obdo(struct obd_connect_data *ocd, }static inline void lustre_get_wire_obdo (struct obd_connect_data *ocd, -struct obdo *lobdo,struct obdo *wobdo) +struct obdo *lobdo, +const struct obdo *wobdo) {obd_flag local_flags =0 ;if (lobdo->o_valid &OBD_MD_FLFLAGS ) local_flags = lobdo->o_flags &OBD_FL_LOCAL_MASK ; -LASSERT (!(wobdo->o_flags &OBD_FL_LOCAL_MASK )); - -memcpy (lobdo, wobdo,sizeof (*lobdo)); + *lobdo = *wobdo;if (local_flags !=0 ) { lobdo->o_valid |=OBD_MD_FLFLAGS ; lobdo->o_flags &= ~OBD_FL_LOCAL_MASK ;
Signature · 1 line
1.7.9.5
PATCH 11/13 staging/lustre/obdclass: remove extra break in class_process_config
In reply to Peng TaoFrom: Artem Blagodarenko <[email protected]>
This is only part of the original Lustre commit, splitted to do the cleanup work.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3155
Lustre-change: http://review.whamcloud.com/6025
--- .../staging/lustre/lustre/obdclass/obd_config.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/staging/lustre/lustre/obdclass/obd_config.c +0 -4
@@ -1226,24 +1226,20 @@ int class_process_config(struct lustre_cfg *lcfg)case LCFG_POOL_NEW : { err =obd_pool_new (obd,lustre_cfg_string (lcfg,2 ));GOTO (out, err =0 ); -break ; }case LCFG_POOL_ADD : { err =obd_pool_add (obd,lustre_cfg_string (lcfg,2 ),lustre_cfg_string (lcfg,3 ));GOTO (out, err =0 ); -break ; }case LCFG_POOL_REM : { err =obd_pool_rem (obd,lustre_cfg_string (lcfg,2 ),lustre_cfg_string (lcfg,3 ));GOTO (out, err =0 ); -break ; }case LCFG_POOL_DEL : { err =obd_pool_del (obd,lustre_cfg_string (lcfg,2 ));GOTO (out, err =0 ); -break ; }default : { err =obd_process_config (obd,sizeof (*lcfg), lcfg);
Signature · 1 line
1.7.9.5
PATCH 13/13 staging/lustre/ptlrpc: flock deadlock detection does not work
In reply to Peng TaoFrom: Andriy Skulysh <[email protected]>
Flock deadlocks are checked on the first attempt to grant the flock only. If we try again to grant it after its blocking lock is cancelled, we don't check for deadlocks which also may exist.
Perform deadlock detection during reprocess
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1715
Lustre-change: http://review.whamcloud.com/3553
--- .../lustre/lustre/include/lustre/lustre_idl.h | 5 ++- .../lustre/lustre/include/lustre_dlm_flags.h | 14 +++++-- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 41 ++++++++++++++++++-- drivers/staging/lustre/lustre/llite/llite_lib.c | 4 +- .../lustre/lustre/obdclass/lprocfs_status.c | 1 + drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 2 + 6 files changed, 58 insertions(+), 9 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +4 -1
@@ -1304,6 +1304,8 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);#define OBD_CONNECT_LIGHTWEIGHT 0x1000000000000ULL/* lightweight connection */ #define OBD_CONNECT_SHORTIO 0x2000000000000ULL/* short io */ #define OBD_CONNECT_PINGLESS 0x4000000000000ULL/* pings not required */ +#define OBD_CONNECT_FLOCK_DEAD 0x8000000000000ULL/* flock deadlock detection */ +/* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same * flag value is not in use on some other branch. Please clear any such
@@ -1341,7 +1343,8 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); OBD_CONNECT_EINPROGRESS | \ OBD_CONNECT_LIGHTWEIGHT | OBD_CONNECT_UMASK | \ OBD_CONNECT_LVB_TYPE | OBD_CONNECT_LAYOUTLOCK |\ - OBD_CONNECT_PINGLESS | OBD_CONNECT_MAX_EASIZE) + OBD_CONNECT_PINGLESS | OBD_CONNECT_MAX_EASIZE |\ + OBD_CONNECT_FLOCK_DEAD)#define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \ OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \ OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX | \
drivers/staging/lustre/lustre/include/lustre_dlm_flags.h +11 -3
@@ -35,10 +35,10 @@#ifndef LDLM_ALL_FLAGS_MASK /** l_flags bits marked as "all_flags" bits */ -#define LDLM_FL_ALL_FLAGS_MASK 0x00FFFFFFC08F132FULL +#define LDLM_FL_ALL_FLAGS_MASK 0x00FFFFFFC08F932FULL/** l_flags bits marked as "ast" bits */ -#define LDLM_FL_AST_MASK 0x0000000080000000ULL +#define LDLM_FL_AST_MASK 0x0000000080008000ULL/** l_flags bits marked as "blocked" bits */ #define LDLM_FL_BLOCKED_MASK 0x000000000000000EULL
@@ -56,7 +56,7 @@#define LDLM_FL_LOCAL_ONLY_MASK 0x00FFFFFF00000000ULL/** l_flags bits marked as "on_wire" bits */ -#define LDLM_FL_ON_WIRE_MASK 0x00000000C08F132FULL +#define LDLM_FL_ON_WIRE_MASK 0x00000000C08F932FULL/** extent, mode, or resource changed */ #define LDLM_FL_LOCK_CHANGED 0x0000000000000001ULL // bit 0
@@ -114,6 +114,12 @@#define ldlm_set_has_intent (_l) LDLM_SET_FLAG(( _l), 1ULL << 12)#define ldlm_clear_has_intent (_l) LDLM_CLEAR_FLAG((_l), 1ULL << 12) +/** flock deadlock detected */ +#define LDLM_FL_FLOCK_DEADLOCK 0x0000000000008000ULL/* bit 15 */ +#define ldlm_is_flock_deadlock (_l) LDLM_TEST_FLAG((_l), 1ULL << 15) +#define ldlm_set_flock_deadlock (_l) LDLM_SET_FLAG((_l), 1ULL << 15) +#define ldlm_clear_flock_deadlock (_l) LDLM_CLEAR_FLAG((_l), 1ULL << 15) +/** discard (no writeback) on cancel */ #define LDLM_FL_DISCARD_DATA 0x0000000000010000ULL // bit 16#define ldlm_is_discard_data (_l) LDLM_TEST_FLAG(( _l), 1ULL << 16)
@@ -390,6 +396,7 @@ static int hf_lustre_ldlm_fl_ast_sent = -1;static int hf_lustre_ldlm_fl_replay =-1 ;static int hf_lustre_ldlm_fl_intent_only =-1 ;static int hf_lustre_ldlm_fl_has_intent =-1 ; +static int hf_lustre_ldlm_fl_flock_deadlock =-1 ;static int hf_lustre_ldlm_fl_discard_data =-1 ;static int hf_lustre_ldlm_fl_no_timeout =-1 ;static int hf_lustre_ldlm_fl_block_nowait =-1 ;
@@ -431,6 +438,7 @@ const value_string lustre_ldlm_flags_vals[] = { {LDLM_FL_REPLAY, "LDLM_FL_REPLAY"}, {LDLM_FL_INTENT_ONLY, "LDLM_FL_INTENT_ONLY"}, {LDLM_FL_HAS_INTENT, "LDLM_FL_HAS_INTENT"}, + {LDLM_FL_FLOCK_DEADLOCK, "LDLM_FL_FLOCK_DEADLOCK"}, {LDLM_FL_DISCARD_DATA, "LDLM_FL_DISCARD_DATA"}, {LDLM_FL_NO_TIMEOUT, "LDLM_FL_NO_TIMEOUT"}, {LDLM_FL_BLOCK_NOWAIT, "LDLM_FL_BLOCK_NOWAIT"},
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +37 -4
77 lines not on this page · raw message
drivers/staging/lustre/lustre/llite/llite_lib.c +3 -1
@@ -206,7 +206,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,OBD_CONNECT_EINPROGRESS |OBD_CONNECT_JOBSTATS |OBD_CONNECT_LVB_TYPE |OBD_CONNECT_LAYOUTLOCK | -OBD_CONNECT_PINGLESS |OBD_CONNECT_MAX_EASIZE ; +OBD_CONNECT_PINGLESS | +OBD_CONNECT_MAX_EASIZE | +OBD_CONNECT_FLOCK_DEAD ;if (sbi->ll_flags &LL_SBI_SOM_PREVIEW ) data->ocd_connect_flags |=OBD_CONNECT_SOM ;
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +1 -0
@@ -98,6 +98,7 @@ static const char * const obd_connect_names[] = {"lightweight_conn" ,"short_io" ,"pingless" , +"flock_deadlock" ,"unknown" , NULL };
drivers/staging/lustre/lustre/ptlrpc/wiretest.c +2 -0
@@ -1152,6 +1152,8 @@ void lustre_assert_wire_constants(void) OBD_CONNECT_SHORTIO);LASSERTF (OBD_CONNECT_PINGLESS ==0x4000000000000ULL ,"found 0x%.16llxULL\n" ,OBD_CONNECT_PINGLESS ); +LASSERTF (OBD_CONNECT_FLOCK_DEAD ==0x8000000000000ULL , +"found 0x%.16llxULL\n" ,OBD_CONNECT_FLOCK_DEAD );LASSERTF (OBD_CKSUM_CRC32 ==0x00000001UL ,"found 0x%.8xUL\n" , (unsigned )OBD_CKSUM_CRC32 ); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
Signature · 1 line
1.7.9.5
PATCH 12/13 staging/lustre/lustre_user.h: remove obsolete comments
In reply to Peng TaoFrom: JC Lafoucriere <[email protected]>
This is only part of the original Lustre commit, main part of which changes user space code. And now the comments above struct hsm_copy is no more true.
Lustre-change: http://review.whamcloud.com/4737
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2062
--- .../lustre/lustre/include/lustre/lustre_user.h | 6 ------ 1 file changed, 6 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +0 -6
@@ -1158,12 +1158,6 @@ struct hsm_progress {__u32 padding; }; -/** -* Use by copytool during any hsm request they handled. -* This structure is initialized by llapi_hsm_copy_start() -* which is an helper over the ioctl() interface -* Store Lustre, internal use only, data. -*/ struct hsm_copy {__u64 hc_data_version;__u16 hc_flags;
Signature · 1 line
1.7.9.5
PATCH 10/13 staging/lustre/mgs: set_param -P option that sets value permanently
In reply to Peng TaoFrom: Artem Blagodarenko <[email protected]>
set_param and conf_param have different syntaxes. Also conf_param has unimplemented paths and no wildcarding support.
This patch adds set_param -P option, that replaces the whole conf_param "direct" proc access with a simple upcall-type mechanism from the MGC. Option conf_param is saved now for compatibility.
Part of the original Lustre commit changes server code. The patch only picks up client side change.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3155
Lustre-change: http://review.whamcloud.com/6025
--- drivers/staging/lustre/lustre/include/lustre_cfg.h | 2 + .../staging/lustre/lustre/include/lustre_disk.h | 2 + drivers/staging/lustre/lustre/include/obd_class.h | 9 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 5 +- drivers/staging/lustre/lustre/mgc/mgc_request.c | 90 +++++++++++++++++--- .../staging/lustre/lustre/obdclass/obd_config.c | 47 +++++++++- 6 files changed, 136 insertions(+), 19 deletions(-)
drivers/staging/lustre/lustre/include/lustre_cfg.h +2 -0
@@ -88,6 +88,8 @@ enum lcfg_command_type {LCFG_SET_LDLM_TIMEOUT =0x00ce030 ,/**< set ldlm_timeout */ LCFG_PRE_CLEANUP =0x00cf031 ,/**< call type-specific pre * cleanup cleanup */ + LCFG_SET_PARAM = 0x00ce032, /**< use set_param syntax to set + *a proc parameters */ }; struct lustre_cfg_bufs {
drivers/staging/lustre/lustre/include/lustre_disk.h +2 -0
@@ -99,6 +99,8 @@#define LDD_F_IR_CAPABLE 0x2000/** the MGS refused to register the target. */ #define LDD_F_ERROR 0x4000 +/** process at lctl conf_param */ +#define LDD_F_PARAM2 0x8000/* opc for target register */ #define LDD_F_OPC_REG 0x10000000
drivers/staging/lustre/lustre/include/obd_class.h +7 -2
@@ -175,9 +175,13 @@ enum {CONFIG_T_CONFIG =0 ,CONFIG_T_SPTLRPC =1 ,CONFIG_T_RECOVER =2 , -CONFIG_T_MAX =3 +CONFIG_T_PARAMS =3 , +CONFIG_T_MAX =4 }; +#define PARAMS_FILENAME "params" +#define LCTL_UPCALL "lctl" +/* list of active configuration logs */ struct config_llog_data { struct ldlm_res_id cld_resid;
@@ -185,7 +189,8 @@ struct config_llog_data {struct list_head cld_list_chain;atomic_t cld_refcount;struct config_llog_data *cld_sptlrpc;/* depended sptlrpc log */ -struct config_llog_data *cld_recover;/* imperative recover log */ +struct config_llog_data *cld_params;/* common parameters log */ +struct config_llog_data *cld_recover;/* imperative recover log */ struct obd_export *cld_mgcexp;struct mutex cld_lock;int cld_type;
drivers/staging/lustre/lustre/llite/llite_lib.c +4 -1
@@ -1060,7 +1060,7 @@ out_free:void ll_put_super (struct super_block *sb) { -struct config_llog_instance cfg; +struct config_llog_instance cfg, params_cfg;struct obd_device *obd;struct lustre_sb_info *lsi =s2lsi (sb);struct ll_sb_info *sbi =ll_s2sbi (sb);
@@ -1074,6 +1074,9 @@ void ll_put_super(struct super_block *sb) cfg.cfg_instance = sb;lustre_end_log (sb, profilenm, &cfg); + params_cfg.cfg_instance = sb; +lustre_end_log (sb,PARAMS_FILENAME , ¶ms_cfg); +if (sbi->ll_md_exp) { obd =class_exp2obd (sbi->ll_md_exp);if (obd)
drivers/staging/lustre/lustre/mgc/mgc_request.c +76 -14
181 lines not on this page · raw message
drivers/staging/lustre/lustre/obdclass/obd_config.c +45 -2
62 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 8/13 staging/lustre/llite: pass correct pointer to obd_iocontrol()
In reply to Peng TaoFrom: "John L. Hammond" <[email protected]>
In copy_and_ioctl() use the kernel space copy as the karg to obd_iocontrol().
Lustre-change: http://review.whamcloud.com/6274
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3283
--- drivers/staging/lustre/lustre/llite/dir.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/staging/lustre/lustre/llite/dir.c +14 -9
@@ -1048,20 +1048,25 @@ progress: } -static int copy_and_ioctl (int cmd,struct obd_export *exp,void *data,int len) +static int copy_and_ioctl (int cmd,struct obd_export *exp, +const void __user *data,size_t size) { -void *ptr; +void *copy;int rc; -OBD_ALLOC (ptr, len); -if (ptr ==NULL ) +OBD_ALLOC (copy, size); +if (copy ==NULL )return -ENOMEM ; -if (copy_from_user (ptr, data, len)) { -OBD_FREE (ptr, len); -return -EFAULT ; + +if (copy_from_user (copy, data, size)) { + rc = -EFAULT ; + goto out; } - rc =obd_iocontrol (cmd, exp, len, data,NULL ); -OBD_FREE (ptr, len); + + rc =obd_iocontrol (cmd, exp, size, copy,NULL ); +out: +OBD_FREE (copy, size); +return rc; }
Signature · 1 line
1.7.9.5
PATCH 6/13 staging/lustre/llite: remove ll_d_root_ops
In reply to Peng TaoFrom: Lai Siyao <[email protected]>
Mnt root dentry will never be revalidated, but its d_op->d_compare will be called for its children, to simplify code, we use the same ll_d_ops as normal dentries.
But its attribute may be invalid before access, this won't cause any issue because it always exists, and the only operation depends on its attribute is .permission, which has revalidated it in lustre code.
So it's okay to remove ll_d_root_ops, and remove unnecessary checks in lookup/revalidate/statahead.
Lustre-change: http://review.whamcloud.com/6797
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3486
--- drivers/staging/lustre/lustre/llite/dcache.c | 41 +++++--------------- .../staging/lustre/lustre/llite/llite_internal.h | 5 ++- drivers/staging/lustre/lustre/llite/llite_lib.c | 11 +----- drivers/staging/lustre/lustre/llite/llite_nfs.c | 6 +-- drivers/staging/lustre/lustre/llite/namei.c | 27 +++++++------ drivers/staging/lustre/lustre/llite/statahead.c | 7 ++-- 6 files changed, 34 insertions(+), 63 deletions(-)
drivers/staging/lustre/lustre/llite/dcache.c +9 -32
@@ -37,6 +37,7 @@#include <linux/fs.h> #include <linux/sched.h> #include <linux/quotaops.h> +#include <linux/kernel.h> #define DEBUG_SUBSYSTEM S_LLITE
@@ -176,7 +177,7 @@ static int ll_ddelete(const struct dentry *de)return 0 ; } -static int ll_set_dd (struct dentry *de) +int ll_d_init (struct dentry *de) {LASSERT (de !=NULL );
@@ -190,40 +191,22 @@ static int ll_set_dd(struct dentry *de)OBD_ALLOC_PTR (lld);if (likely (lld !=NULL )) {spin_lock (&de->d_lock); -if (likely (de->d_fsdata ==NULL )) +if (likely (de->d_fsdata ==NULL )) { de->d_fsdata = lld; -else +__d_lustre_invalidate (de); + }else {OBD_FREE_PTR (lld); + }spin_unlock (&de->d_lock); }else {return -ENOMEM ; } } +LASSERT (de->d_op == &ll_d_ops);return 0 ; } -int ll_dops_init (struct dentry *de,int block,int init_sa) -{ -struct ll_dentry_data *lld =ll_d2d (de); -int rc =0 ; - -if (lld ==NULL && block !=0 ) { - rc =ll_set_dd (de); -if (rc) -return rc; - - lld =ll_d2d (de); - } - -if (lld !=NULL && init_sa !=0 ) - lld->lld_sa_generation =0 ; - -/* kernel >= 2.6.38 d_op is set in d_alloc() */ -LASSERT (de->d_op == &ll_d_ops); -return rc; -} -void ll_intent_drop_lock (struct lookup_intent *it) {if (it->it_op && it->d.lustre.it_lock_mode) {
@@ -359,6 +342,8 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,CDEBUG (D_VFSTRACE ,"VFS Op:name=%s,intent=%s\n" , de->d_name.name,LL_IT2STR (it)); +LASSERT (de != de->d_sb->s_root); +if (de->d_inode ==NULL ) {__u64 ibits;
@@ -383,14 +368,6 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags,if (d_mountpoint (de))GOTO (out_sa, rc =1 ); -/* need to get attributes in case root got changed from other client */ -if (de == de->d_sb->s_root) { - rc =__ll_inode_revalidate_it (de, it,MDS_INODELOCK_LOOKUP ); -if (rc ==0 ) - rc =1 ; -GOTO (out_sa, rc); - } - exp =ll_i2mdexp (de->d_inode);OBD_FAIL_TIMEOUT (OBD_FAIL_MDC_REVALIDATE_PAUSE ,5 );
drivers/staging/lustre/lustre/llite/llite_internal.h +3 -2
@@ -828,7 +828,7 @@ int ll_lease_close(struct obd_client_handle *och, struct inode *inode,/* llite/dcache.c */ -int ll_dops_init (struct dentry *de,int block,int init_sa); +int ll_d_init (struct dentry *de);extern struct dentry_operations ll_d_ops;void ll_intent_drop_lock (struct lookup_intent *);void ll_intent_release (struct lookup_intent *);
@@ -1320,7 +1320,8 @@ ll_statahead_mark(struct inode *dir, struct dentry *dentry)if (lli->lli_opendir_pid !=current_pid ())return ; -if (sai !=NULL && ldd !=NULL ) +LASSERT (ldd !=NULL ); +if (sai !=NULL ) ldd->lld_sa_generation = sai->sai_generation; }
drivers/staging/lustre/lustre/llite/llite_lib.c +2 -9
@@ -155,11 +155,6 @@ void ll_free_sbi(struct super_block *sb) } } -static struct dentry_operations ll_d_root_ops = { - .d_compare = ll_dcompare, - .d_revalidate = ll_revalidate_nd, -}; -static int client_common_fill_super (struct super_block *sb,char *md,char *dt,struct vfsmount *mnt) {
@@ -579,10 +574,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,GOTO (out_root, err = -ENOMEM ); } -/* kernel >= 2.6.38 store dentry operations in sb->s_d_op. */ -d_set_d_op (sb->s_root, &ll_d_root_ops); - sb->s_d_op = &ll_d_ops; - sbi->ll_sdev_orig = sb->s_dev;/* We set sb->s_dev equal on all lustre clients in order to support
@@ -1013,6 +1004,8 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)GOTO (out_free, err); sb->s_bdi = &lsi->lsi_bdi; +/* kernel >= 2.6.38 store dentry operations in sb->s_d_op. */ + sb->s_d_op = &ll_d_ops;/* Generate a string unique to this super, in case some joker tries to mount the same fs at two mount points.
drivers/staging/lustre/lustre/llite/llite_nfs.c +3 -3
@@ -167,10 +167,10 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren } result =d_obtain_alias (inode); -if (IS_ERR (result)) +if (IS_ERR (result)) { +iput (inode);return result; - -ll_dops_init (result,1 ,0 ); + }return result; }
drivers/staging/lustre/lustre/llite/namei.c +13 -14
@@ -400,11 +400,16 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)struct dentry *ll_splice_alias (struct inode *inode,struct dentry *de) {struct dentry *new; +int rc;if (inode) { new =ll_find_alias (inode, de);if (new) { -ll_dops_init (new,1 ,1 ); + rc =ll_d_init (new); +if (rc <0 ) { +dput (new); +return ERR_PTR (rc); + }d_move (new, de);iput (inode); CDEBUG(D_DENTRY,
@@ -413,8 +418,9 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de)return new; } } -ll_dops_init (de,1 ,1 ); -__d_lustre_invalidate (de); + rc =ll_d_init (de); +if (rc <0 ) +return ERR_PTR (rc);d_add (de, inode);CDEBUG (D_DENTRY ,"Add dentry %p inode %p refc %d flags %#x\n" , de, de->d_inode,d_count (de), de->d_flags);
@@ -455,8 +461,11 @@ int ll_lookup_it_finish(struct ptlrpc_request *request,/* Only hash *de if it is unhashed (new dentry). * Atoimc_open may passin hashed dentries for open. */ -if (d_unhashed (*de)) +if (d_unhashed (*de)) { *de =ll_splice_alias (inode, *de); +if (IS_ERR (*de)) +return PTR_ERR (*de); + }if (!it_disposition (it,DISP_LOOKUP_NEG )) {/* we have lookup look - unhide dentry */
@@ -505,16 +514,6 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,ll_frob_intent (&it, &lookup_it); -/* As do_lookup is called before follow_mount, root dentry may be left -* not valid, revalidate it here. */ -if (parent->i_sb->s_root && (parent->i_sb->s_root->d_inode == parent) && - (it->it_op & (IT_OPEN |IT_CREAT ))) { - rc =ll_inode_revalidate_it (parent->i_sb->s_root, it, -MDS_INODELOCK_LOOKUP ); -if (rc) -return ERR_PTR (rc); - } -if (it->it_op ==IT_GETATTR ) { rc =ll_statahead_enter (parent, &dentry,0 );if (rc ==1 ) {
drivers/staging/lustre/lustre/llite/statahead.c +4 -3
@@ -877,9 +877,6 @@ static int do_sa_revalidate(struct inode *dir, struct ll_sa_entry *entry,if (d_mountpoint (dentry))return 1 ; -if (unlikely (dentry == dentry->d_sb->s_root)) -return 1 ; - entry->se_inode =igrab (inode); rc =md_revalidate_lock (ll_i2mdexp (dir), &it,ll_inode2fid (inode),NULL );if (rc ==1 ) {
@@ -1590,6 +1587,10 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp,if ((*dentryp)->d_inode ==NULL ) { *dentryp =ll_splice_alias (inode, *dentryp); +if (IS_ERR (*dentryp)) { +ll_sai_unplug (sai, entry); +return PTR_ERR (*dentryp); + } }else if ((*dentryp)->d_inode != inode) {/* revalidate, but inode is recreated */ CDEBUG(D_READA,
Signature · 1 line
1.7.9.5
PATCH 3/13 staging/lustre/api: HSM import uses new released pattern
In reply to Peng TaoFrom: JC Lafoucriere <[email protected]>
Import creates a released file using new RAID pattern flag Import used a new ioctl() to implement the import in the client kernel.
Lustre-change: http://review.whamcloud.com/6536
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3363
--- .../lustre/lustre/include/lustre/lustre_user.h | 17 ++- drivers/staging/lustre/lustre/llite/file.c | 118 ++++++++++++++++---- .../staging/lustre/lustre/llite/llite_internal.h | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 24 ++-- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 58 ++++++++++ 5 files changed, 187 insertions(+), 32 deletions(-)
drivers/staging/lustre/lustre/include/lustre/lustre_user.h +16 -1
@@ -244,9 +244,9 @@ struct ost_id {#define LL_IOC_LMV_SETSTRIPE _IOWR('f', 240, struct lmv_user_md)#define LL_IOC_LMV_GETSTRIPE _IOWR('f', 241, struct lmv_user_md)#define LL_IOC_REMOVE_ENTRY _IOWR('f', 242, __u64) -#define LL_IOC_SET_LEASE _IOWR('f', 243, long)#define LL_IOC_GET_LEASE _IO('f', 244) +#define LL_IOC_HSM_IMPORT _IOWR('f', 245, struct hsm_user_import)#define LL_STATFS_LMV 1#define LL_STATFS_LOV 2
@@ -1130,6 +1130,21 @@ static inline int hal_size(struct hsm_action_list *hal)return sz; } +/* HSM file import +* describe the attributes to be set on imported file +*/ +struct hsm_user_import { +__u64 hui_size; +__u64 hui_atime; +__u64 hui_mtime; +__u32 hui_atime_ns; +__u32 hui_mtime_ns; +__u32 hui_uid; +__u32 hui_gid; +__u32 hui_mode; +__u32 hui_archive_id; +}; +/* Copytool progress reporting */ #define HP_FLAG_COMPLETED 0x01#define HP_FLAG_RETRY 0x02
drivers/staging/lustre/lustre/llite/file.c +98 -20
148 lines not on this page · raw message
drivers/staging/lustre/lustre/llite/llite_internal.h +1 -1
@@ -851,7 +851,7 @@ void ll_kill_super(struct super_block *sb);struct inode *ll_inode_from_resource_lock (struct ldlm_lock *lock);struct inode *ll_inode_from_lock (struct ldlm_lock *lock);void ll_clear_inode (struct inode *inode); -int ll_setattr_raw (struct dentry *dentry,struct iattr *attr); +int ll_setattr_raw (struct dentry *dentry,struct iattr *attr,bool hsm_import);int ll_setattr (struct dentry *de,struct iattr *attr);int ll_statfs (struct dentry *de,struct kstatfs *sfs); int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
drivers/staging/lustre/lustre/llite/llite_lib.c +14 -10
@@ -1364,8 +1364,10 @@ static int ll_setattr_ost(struct inode *inode, struct iattr *attr)* to the OST with the punch RPC, otherwise we do an explicit setattr RPC. * I don't believe it is possible to get e.g. ATTR_MTIME_SET and ATTR_SIZE * at the same time. +* +* In case of HSMimport, we only set attr on MDS. */ -int ll_setattr_raw (struct dentry *dentry,struct iattr *attr) +int ll_setattr_raw (struct dentry *dentry,struct iattr *attr,bool hsm_import) {struct inode *inode = dentry->d_inode;struct ll_inode_info *lli =ll_i2info (inode);
@@ -1374,10 +1376,12 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)bool file_is_released = false;int rc =0 , rc1 =0 ; -CDEBUG (D_VFSTRACE ,"%s: setattr inode %p/fid:" DFID " from %llu to %llu, " -"valid %x\n" ,ll_get_fsname (inode->i_sb,NULL ,0 ), inode, +CDEBUG (D_VFSTRACE , +"%s: setattr inode %p/fid:" DFID +" from %llu to %llu, valid %x, hsm_import %d\n" , +ll_get_fsname (inode->i_sb,NULL ,0 ), inode,PFID (&lli->lli_fid),i_size_read (inode), attr->ia_size, - attr->ia_valid); + attr->ia_valid, hsm_import);if (attr->ia_valid &ATTR_SIZE ) {/* Check new size against VFS/VM file size limit and rlimit */
@@ -1470,20 +1474,20 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)ccc_inode_lsm_put (inode, lsm); } -/* clear size attr for released file +/* if not in HSM import mode, clear size attr for released file * we clear the attribute send to MDT in op_data, not the original * received from caller in attr which is used later to * decide return code */ -if (file_is_released && (attr->ia_valid &ATTR_SIZE )) +if (file_is_released && (attr->ia_valid &ATTR_SIZE ) && !hsm_import) op_data->op_attr.ia_valid &= ~ATTR_SIZE ; rc =ll_md_setattr (dentry, op_data, &mod);if (rc)GOTO (out, rc); -/* truncate failed, others succeed */ +/* truncate failed (only when non HSM import), others succeed */ if (file_is_released) { -if (attr->ia_valid &ATTR_SIZE ) +if ((attr->ia_valid &ATTR_SIZE ) && !hsm_import)GOTO (out, rc = -ENODATA );else GOTO (out, rc =0 );
@@ -1522,7 +1526,7 @@ out:if (!S_ISDIR (inode->i_mode)) {up_write (&lli->lli_trunc_sem);mutex_lock (&inode->i_mutex); -if (attr->ia_valid &ATTR_SIZE ) +if ((attr->ia_valid &ATTR_SIZE ) && !hsm_import)inode_dio_wait (inode); }
@@ -1557,7 +1561,7 @@ int ll_setattr(struct dentry *de, struct iattr *attr) !(attr->ia_valid & ATTR_KILL_SGID)) attr->ia_valid |=ATTR_KILL_SGID ; -return ll_setattr_raw (de, attr); +return ll_setattr_raw (de, attr, false); } int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
drivers/staging/lustre/lustre/ptlrpc/wiretest.c +58 -0
64 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Greg Kroah-Hartman
maintainerRe: [PATCH 06/13] staging/lustre/llite: remove ll_d_root_ops
In reply to Peng TaoQuoted 10 lines · Peng Tao
From: Lai Siyao <[email protected]>
Mnt root dentry will never be revalidated, but its
d_op->d_comparewill be called for its children, to simplify code, we use the samell_d_opsas normal dentries.
But its attribute may be invalid before access, this won't cause any issue because it always exists, and the only operation depends on its attribute is .permission, which has revalidated it in lustre code.
Quoted 2 lines
So it's okay to remove
ll_d_root_ops, and remove unnecessary checks in lookup/revalidate/statahead.
This breaks the build.
It's as if you aren't testing this.
I'm really tired of this, I really don't want to take any more patches from you for a while, as I dread them every time I see a series sent by you for this codebase.
ugh.
Re: [PATCH 06/13] staging/lustre/llite: remove ll_d_root_ops
Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Peng Tao
From: Lai Siyao <[email protected]>
Mnt root dentry will never be revalidated, but its
d_op->d_comparewill be called for its children, to simplify code, we use the samell_d_opsas normal dentries.
But its attribute may be invalid before access, this won't cause any issue because it always exists, and the only operation depends on its attribute is .permission, which has revalidated it in lustre code.
Quoted 7 lines
Quoted 2 lines
So it's okay to remove
ll_d_root_ops, and remove unnecessary checks in lookup/revalidate/statahead.This breaks the build.
It's as if you aren't testing this.
err... I tested the series as a whole but it turns out this breakage got fixed in the next patch. Looks like I should really have tested every single patch instead.
sorry...
Quoted 4 lines
I'm really tired of this, I really don't want to take any more patches from you for a while, as I dread them every time I see a series sent by you for this codebase.
I'll give you a break then... sorry for getting you annoyed.
Thanks,
Tao