From patchwork Mon Apr 17 13:46:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 13214037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman-customer002.dreamhost.com (listserver-buz.dreamhost.com [69.163.136.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA6A1C77B76 for ; Mon, 17 Apr 2023 13:47:56 +0000 (UTC) Received: from pdx1-mailman-customer002.dreamhost.com (localhost [127.0.0.1]) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTP id 4Q0SzY2p26z1yCS; Mon, 17 Apr 2023 06:47:37 -0700 (PDT) Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTPS id 4Q0SzN1m7Cz1y6h for ; Mon, 17 Apr 2023 06:47:28 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id 5DB401005F9F; Mon, 17 Apr 2023 09:47:24 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 5097B375; Mon, 17 Apr 2023 09:47:24 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 17 Apr 2023 09:46:58 -0400 Message-Id: <1681739243-29375-3-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1681739243-29375-1-git-send-email-jsimmons@infradead.org> References: <1681739243-29375-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 02/27] lustre: lov: continue fsync on other OST objs even on -ENOENT X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.39 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: Bobi Jam When fsync races with truncate, we'd continue to other OST object's fsync even some stripe fsync returns -ENOENT, so that on client it could potentially discard caching pages by calling osc_io_fsync_start()->osc_cache_writebase_range(). WC-bug-id: https://jira.whamcloud.com/browse/LU-16263 Lustre-commit: 927b5cd49c3369d53 ("LU-16263 lov: continue fsync on other OST objs even on -ENOENT") Signed-off-by: Bobi Jam Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50005 Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Reviewed-by: Alex Zhuravlev Signed-off-by: James Simmons --- fs/lustre/lov/lov_io.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c index 32f028b..4c842cd 100644 --- a/fs/lustre/lov/lov_io.c +++ b/fs/lustre/lov/lov_io.c @@ -1013,8 +1013,16 @@ static int lov_io_call(const struct lu_env *env, struct lov_io *lio, list_for_each_entry(sub, &lio->lis_active, sub_linkage) { rc = iofunc(sub->sub_env, &sub->sub_io); - if (rc) + if (rc) { + /** + * fsync race with truncate, we'd continue to other + * OST object's fsync to potentially discard + * caching pages (osc_cache_writeback_range). + */ + if (rc == -ENOENT && parent->ci_type == CIT_FSYNC) + continue; break; + } if (parent->ci_result == 0) parent->ci_result = sub->sub_io.ci_result;