lustre-devel-lustre.org archive mirror
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Andreas Dilger <adilger@whamcloud.com>,
	Oleg Drokin <green@whamcloud.com>, NeilBrown <neilb@suse.de>
Cc: Shaun Tancheff <shaun.tancheff@hpe.com>,
	Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [lustre-devel] [PATCH 7/7] lustre: clio: Disable lockless for DIO with O_APPEND
Date: Mon, 18 Apr 2022 20:31:04 -0400	[thread overview]
Message-ID: <1650328264-8763-8-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1650328264-8763-1-git-send-email-jsimmons@infradead.org>

From: Shaun Tancheff <shaun.tancheff@hpe.com>

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 <shaun.tancheff@hpe.com>
Reviewed-on: https://review.whamcloud.com/46890
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 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;
 
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

      parent reply	other threads:[~2022-04-19  0:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19  0:30 [lustre-devel] [PATCH 0/7] lustre: OpenSFS updates April 18, 2022 James Simmons
2022-04-19  0:30 ` [lustre-devel] [PATCH 1/7] lustre: ptlrpc: unregister reply buffer on rq_err James Simmons
2022-04-19  0:30 ` [lustre-devel] [PATCH 2/7] lustre: llite: Fix use of uninitialized fields James Simmons
2022-04-19  0:31 ` [lustre-devel] [PATCH 3/7] lustre: lov: remove lo_trunc_stripeno James Simmons
2022-04-19  0:31 ` [lustre-devel] [PATCH 4/7] lustre: lmv: change default hash back to fnv_1a_64 James Simmons
2022-04-19  0:31 ` [lustre-devel] [PATCH 5/7] lnet: only update gateway NI status on discovery James Simmons
2022-04-19  0:31 ` [lustre-devel] [PATCH 6/7] lnet: ln_api_mutex deadlocks James Simmons
2022-04-19  0:31 ` James Simmons [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1650328264-8763-8-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=adilger@whamcloud.com \
    --cc=green@whamcloud.com \
    --cc=lustre-devel@lists.lustre.org \
    --cc=neilb@suse.de \
    --cc=shaun.tancheff@hpe.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).