From 3483e195314bddb8d72594ebb10307c83a4bb860 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Thu, 7 Dec 2017 07:00:58 -0600 Subject: [PATCH] LU-1757 brw: Fix short i/o and enable for mdc The short i/o flag was left out of the OST flags in the original patch, meaning it was not really on. Also, the short_io_size value was used uninitialized, meaning it was sometimes non-zero, which coudl lead to several issues. Also add the short i/o flag to the MDC/MDT for data on MDT. Quick testing suggests this works fine with no further changes. Cray-bug-id: LUS-187 Signed-off-by: Patrick Farrell Change-Id: I4154b87d5ad73b53467b0382368fad7c5ba177fe Reviewed-on: https://review.whamcloud.com/30435 Tested-by: Jenkins Reviewed-by: Mike Pershin Reviewed-by: Alexandr Boyko Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/include/lustre_net.h | 5 +++-- lustre/include/uapi/linux/lustre/lustre_idl.h | 5 +++-- lustre/llite/llite_lib.c | 3 ++- lustre/osc/osc_request.c | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 353cb7a..91d014d 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -2071,11 +2071,12 @@ static inline int ptlrpc_client_bulk_active(struct ptlrpc_request *req) LASSERT(req != NULL); desc = req->rq_bulk; + if (!desc) + return 0; + if (req->rq_bulk_deadline > ktime_get_real_seconds()) return 1; - if (!desc) - return 0; spin_lock(&desc->bd_lock); rc = desc->bd_md_count; diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 9e199d27..fac28da 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -851,7 +851,7 @@ struct ptlrpc_body_v2 { OBD_CONNECT_MULTIMODRPCS | \ OBD_CONNECT_SUBTREE | OBD_CONNECT_LARGE_ACL | \ OBD_CONNECT_GRANT_PARAM | \ - OBD_CONNECT_FLAGS2) + OBD_CONNECT_SHORTIO | OBD_CONNECT_FLAGS2) #define MDT_CONNECT_SUPPORTED2 OBD_CONNECT2_FILE_SECCTX @@ -871,7 +871,8 @@ struct ptlrpc_body_v2 { OBD_CONNECT_LAYOUTLOCK | OBD_CONNECT_FID | \ OBD_CONNECT_PINGLESS | OBD_CONNECT_LFSCK | \ OBD_CONNECT_BULK_MBITS | \ - OBD_CONNECT_GRANT_PARAM | OBD_CONNECT_FLAGS2) + OBD_CONNECT_GRANT_PARAM | \ + OBD_CONNECT_SHORTIO | OBD_CONNECT_FLAGS2) #define OST_CONNECT_SUPPORTED2 OBD_CONNECT2_LOCKAHEAD diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 72b77fc..89d438a 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -220,7 +220,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, OBD_CONNECT_BULK_MBITS | OBD_CONNECT_CKSUM | OBD_CONNECT_SUBTREE | OBD_CONNECT_MULTIMODRPCS | - OBD_CONNECT_GRANT_PARAM | OBD_CONNECT_FLAGS2; + OBD_CONNECT_GRANT_PARAM | + OBD_CONNECT_SHORTIO | OBD_CONNECT_FLAGS2; data->ocd_connect_flags2 = 0; diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 9509ff2..006715f 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1093,7 +1093,7 @@ osc_brw_prep_request(int cmd, struct client_obd *cli, struct obdo *oa, struct ost_body *body; struct obd_ioobj *ioobj; struct niobuf_remote *niobuf; - int niocount, i, requested_nob, opc, rc, short_io_size; + int niocount, i, requested_nob, opc, rc, short_io_size = 0; struct osc_brw_async_args *aa; struct req_capsule *pill; struct brw_page *pg_prev; -- 1.8.3.1