From patchwork Thu Feb 27 21:17:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410803 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 145F21580 for ; Thu, 27 Feb 2020 21:47:15 +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 F129324690 for ; Thu, 27 Feb 2020 21:47:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F129324690 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 CBBAA34A1EA; Thu, 27 Feb 2020 13:37:20 -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 E786B34898F for ; Thu, 27 Feb 2020 13:21:15 -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 F07AB91D4; Thu, 27 Feb 2020 16:18:19 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id EF5EA47C; Thu, 27 Feb 2020 16:18:19 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:17:17 -0500 Message-Id: <1582838290-17243-570-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 569/622] lustre: obdclass: don't skip records for wrapped catalog 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: Alexander Boyko , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Alexander Boyko osp_sync_thread() uses opd_sync_last_catalog_idx as a start point of catalog processing. It is used at llog_cat_process_cb also, to skip records from processing. When catalog is wrapped, processing starts from second part of catalog and then a first part. So, a first part would be skipped at llog_cat_process_cb() base on lpd_startcat. osp_sync_thread() restarts a processing loop with a opd_sync_last_catalog_idx. For a wrapped it increases last index and one more increase do a llog_process_thread. This leads to a skipped records at catalog, they would not be processed. The patch fixes these issues. It also adds sanity test 135 and 136 as regression tests. WC-bug-id: https://jira.whamcloud.com/browse/LU-13069 Lustre-commit: cc1092291932 ("LU-13069 obdclass: don't skip records for wrapped catalog") Signed-off-by: Alexander Boyko Cray-bug-id: LUS-8053,LUS-8236 Reviewed-on: https://review.whamcloud.com/36996 Reviewed-by: Andriy Skulysh Reviewed-by: Alexander Zarochentsev Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/include/obd_support.h | 2 ++ fs/lustre/obdclass/llog.c | 9 +++++++++ fs/lustre/obdclass/llog_cat.c | 1 + 3 files changed, 12 insertions(+) diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h index 5969b6b..a26ac76 100644 --- a/fs/lustre/include/obd_support.h +++ b/fs/lustre/include/obd_support.h @@ -447,6 +447,8 @@ /* was OBD_FAIL_LLOG_CATINFO_NET 0x1309 until 2.3 */ #define OBD_FAIL_MDS_SYNC_CAPA_SL 0x1310 #define OBD_FAIL_SEQ_ALLOC 0x1311 +#define OBD_FAIL_PLAIN_RECORDS 0x1319 +#define OBD_FAIL_CATALOG_FULL_CHECK 0x131a #define OBD_FAIL_LLITE 0x1400 #define OBD_FAIL_LLITE_FAULT_TRUNC_RACE 0x1401 diff --git a/fs/lustre/obdclass/llog.c b/fs/lustre/obdclass/llog.c index 4e9fd17..620ebc6 100644 --- a/fs/lustre/obdclass/llog.c +++ b/fs/lustre/obdclass/llog.c @@ -453,6 +453,8 @@ int llog_process_or_fork(const struct lu_env *env, llog_cb_t cb, void *data, void *catdata, bool fork) { struct llog_process_info *lpi; + struct llog_process_data *d = data; + struct llog_process_cat_data *cd = catdata; int rc; lpi = kzalloc(sizeof(*lpi), GFP_KERNEL); @@ -463,6 +465,13 @@ int llog_process_or_fork(const struct lu_env *env, lpi->lpi_cbdata = data; lpi->lpi_catdata = catdata; + CDEBUG(D_OTHER, + "Processing " DFID " flags 0x%03x startcat %d startidx %d first_idx %d last_idx %d\n", + PFID(&loghandle->lgh_id.lgl_oi.oi_fid), + loghandle->lgh_hdr->llh_flags, d ? d->lpd_startcat : -1, + d ? d->lpd_startidx : -1, cd ? cd->lpcd_first_idx : -1, + cd ? cd->lpcd_last_idx : -1); + if (fork) { struct task_struct *task; diff --git a/fs/lustre/obdclass/llog_cat.c b/fs/lustre/obdclass/llog_cat.c index 30b0ac5..75226f4 100644 --- a/fs/lustre/obdclass/llog_cat.c +++ b/fs/lustre/obdclass/llog_cat.c @@ -244,6 +244,7 @@ static int llog_cat_process_or_fork(const struct lu_env *env, * catalog bottom. */ startcat = 0; + d.lpd_startcat = 0; if (rc != 0) return rc; }