From patchwork Thu Feb 27 21:14:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410689 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 DCC9A17E0 for ; Thu, 27 Feb 2020 21:44:27 +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 C5AFF24690 for ; Thu, 27 Feb 2020 21:44:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5AFF24690 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 BB1DB3498D4; Thu, 27 Feb 2020 13:35:34 -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 98A5921FCA4 for ; Thu, 27 Feb 2020 13:20:23 -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 0CCFC8F0A; Thu, 27 Feb 2020 16:18:18 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 0BBC946C; Thu, 27 Feb 2020 16:18:18 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:14:31 -0500 Message-Id: <1582838290-17243-404-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 403/622] lustre: osc: Do not assert for first extent 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: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Patrick Farrell In the discard case, the OSC fsync/writeback code asserts that each OSC extent is fully covered by the fsync request. This is not valid for the DOM case, because OSC extent alignment requirements can create OSC extents which start before the OST region of the layout (ie, they cross in to the DOM region). This is OK because the layout prevents them from ever being used for i/o, but this same behavior means that the OSC fsync start/end is aligned with the layout, and so does not necessarily cover that first extent. The simplest solution is just to not assert on the first extent. (There is no way at the OSC layer to recognize the DOM case.) WC-bug-id: https://jira.whamcloud.com/browse/LU-12462 Lustre-commit: 092ecd66127e ("LU-12462 osc: Do not assert for first extent") Signed-off-by: Patrick Farrell Reviewed-on: https://review.whamcloud.com/35525 Reviewed-by: Mike Pershin Reviewed-by: Andriy Skulysh Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/osc/osc_cache.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fs/lustre/osc/osc_cache.c b/fs/lustre/osc/osc_cache.c index 3b4c598..9e2f90d 100644 --- a/fs/lustre/osc/osc_cache.c +++ b/fs/lustre/osc/osc_cache.c @@ -2931,10 +2931,17 @@ int osc_cache_writeback_range(const struct lu_env *env, struct osc_object *obj, unplug = true; } else { /* the only discarder is lock cancelling, so - * [start, end] must contain this extent + * [start, end] must contain this extent. + * However, with DOM, osc extent alignment may + * cause the first extent to start before the + * OST portion of the layout. This is never + * accessed for i/o, but the unused portion + * will not be covered by the sync request, + * so we cannot assert in that case. */ - EASSERT(ext->oe_start >= start && - ext->oe_end <= end, ext); + EASSERT(ergo(!(ext == first_extent(obj)), + ext->oe_start >= start && + ext->oe_end <= end), ext); osc_extent_state_set(ext, OES_LOCKING); ext->oe_owner = current; list_move_tail(&ext->oe_link, &discard_list);