diff mbox series

[7/7] lustre: clio: Disable lockless for DIO with O_APPEND

Message ID 1650328264-8763-8-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: OpenSFS updates April 18, 2022 | expand

Commit Message

James Simmons April 19, 2022, 12:31 a.m. UTC
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 mbox series

Patch

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;