From patchwork Thu Feb 27 21:17:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410829 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B74C61580 for ; Thu, 27 Feb 2020 21:47:51 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F8DF24690 for ; Thu, 27 Feb 2020 21:47:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F8DF24690 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 4B47E34B52A; Thu, 27 Feb 2020 13:37:56 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 01EBA3489F6 for ; Thu, 27 Feb 2020 13:21:24 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 4B91CA150; Thu, 27 Feb 2020 16:18:20 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 4A69847C; Thu, 27 Feb 2020 16:18:20 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:17:45 -0500 Message-Id: <1582838290-17243-598-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 597/622] lustre: dom: check read-on-open buffer presents in reply X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mikhail Pershin , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Mikhail Pershin The ll_dom_finish_open() uses req_capsule_has_field() wronly, it check only format but not buffer presence in reply, that causes unneeded console errors about missing buffer later in req_capsule_server_get() Patch replaces that with req_capsule_field_present() to check if server pack that field in reply or not and properly skip responses from an old server. WC-bug-id: https://jira.whamcloud.com/browse/LU-13136 Lustre-commit: 58bea527100b ("LU-13136 dom: check read-on-open buffer presents in reply") Signed-off-by: Mikhail Pershin Reviewed-on: https://review.whamcloud.com/37249 Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Reviewed-by: Stephane Thiell Signed-off-by: James Simmons --- fs/lustre/include/lustre_req_layout.h | 3 +++ fs/lustre/llite/file.c | 4 ++-- fs/lustre/ptlrpc/layout.c | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/fs/lustre/include/lustre_req_layout.h b/fs/lustre/include/lustre_req_layout.h index feb5e77..ea6baef 100644 --- a/fs/lustre/include/lustre_req_layout.h +++ b/fs/lustre/include/lustre_req_layout.h @@ -112,6 +112,9 @@ u32 req_capsule_fmt_size(u32 magic, const struct req_format *fmt, int req_capsule_has_field(const struct req_capsule *pill, const struct req_msg_field *field, enum req_location loc); +int req_capsule_field_present(const struct req_capsule *pill, + const struct req_msg_field *field, + enum req_location loc); void req_capsule_shrink(struct req_capsule *pill, const struct req_msg_field *field, u32 newlen, enum req_location loc); diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c index a3c36a7..c7233bf 100644 --- a/fs/lustre/llite/file.c +++ b/fs/lustre/llite/file.c @@ -459,8 +459,8 @@ void ll_dom_finish_open(struct inode *inode, struct ptlrpc_request *req, if (!obj) return; - if (!req_capsule_has_field(&req->rq_pill, &RMF_NIOBUF_INLINE, - RCL_SERVER)) + if (!req_capsule_field_present(&req->rq_pill, &RMF_NIOBUF_INLINE, + RCL_SERVER)) return; rnb = req_capsule_server_get(&req->rq_pill, &RMF_NIOBUF_INLINE); diff --git a/fs/lustre/ptlrpc/layout.c b/fs/lustre/ptlrpc/layout.c index 06db86d..4213fb2 100644 --- a/fs/lustre/ptlrpc/layout.c +++ b/fs/lustre/ptlrpc/layout.c @@ -2268,9 +2268,9 @@ int req_capsule_has_field(const struct req_capsule *pill, * Returns a non-zero value if the given @field is present in the given * @pill's PTLRPC request or reply (@loc), else it returns 0. */ -static int req_capsule_field_present(const struct req_capsule *pill, - const struct req_msg_field *field, - enum req_location loc) +int req_capsule_field_present(const struct req_capsule *pill, + const struct req_msg_field *field, + enum req_location loc) { u32 offset; @@ -2280,6 +2280,7 @@ static int req_capsule_field_present(const struct req_capsule *pill, offset = __req_capsule_offset(pill, field, loc); return lustre_msg_bufcount(__req_msg(pill, loc)) > offset; } +EXPORT_SYMBOL(req_capsule_field_present); /** * This function shrinks the size of the _buffer_ of the @pill's PTLRPC