From patchwork Tue Apr 19 00:31:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 12817179 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-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 smtp.lore.kernel.org (Postfix) with ESMTPS id B3785C433EF for ; Tue, 19 Apr 2022 00:31:29 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id C9E2D4274B5; Mon, 18 Apr 2022 17:31:15 -0700 (PDT) Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 4B192423F77 for ; Mon, 18 Apr 2022 17:31:09 -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 3A41F1005EE1; Mon, 18 Apr 2022 20:31:06 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 3009AD58C0; Mon, 18 Apr 2022 20:31:06 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 18 Apr 2022 20:31:04 -0400 Message-Id: <1650328264-8763-8-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1650328264-8763-1-git-send-email-jsimmons@infradead.org> References: <1650328264-8763-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 7/7] lustre: clio: Disable lockless for DIO with O_APPEND 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: Shaun Tancheff , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Shaun Tancheff Lockless O_DIRECT with O_APPEND can allow interleaved / racy appends from concurrent I/O. Disable lockless I/O when O_APPEND is set HPE-bug-id: LUS-9776 WC-bug-id: https://jira.whamcloud.com/browse/LU-15670 Lustre-commit: 649d638467c037579 ("LU-15670 clio: Disable lockless for DIO with O_APPEND") Signed-off-by: Shaun Tancheff Reviewed-on: https://review.whamcloud.com/46890 Reviewed-by: Patrick Farrell Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/llite/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c index 4855156..1ac3e4f 100644 --- a/fs/lustre/llite/file.c +++ b/fs/lustre/llite/file.c @@ -1673,6 +1673,8 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot, io = vvp_env_thread_io(env); if (file->f_flags & O_DIRECT) { + if (file->f_flags & O_APPEND) + dio_lock = 1; if (!is_sync_kiocb(args->u.normal.via_iocb)) is_aio = true;