All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@fb.com>
To: <axboe@kernel.dk>, <io-uring@vger.kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>, Keith Busch <kbusch@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH] fs: don't randomized kiocb fields
Date: Fri, 12 Aug 2022 15:56:33 -0700	[thread overview]
Message-ID: <20220812225633.3287847-1-kbusch@fb.com> (raw)

From: Keith Busch <kbusch@kernel.org>

This is a size sensitive structure and randomizing can introduce extra
padding that breaks io_uring's fixed size expectations. There are few
fields here as it is, half of which need a fixed order to optimally
pack, so the randomization isn't providing much.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 include/linux/fs.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5113f65c786f..9eced4cc286e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -340,17 +340,12 @@ enum rw_hint {
 
 struct kiocb {
 	struct file		*ki_filp;
-
-	/* The 'ki_filp' pointer is shared in a union for aio */
-	randomized_struct_fields_start
-
 	loff_t			ki_pos;
 	void (*ki_complete)(struct kiocb *iocb, long ret);
 	void			*private;
 	int			ki_flags;
 	u16			ki_ioprio; /* See linux/ioprio.h */
 	struct wait_page_queue	*ki_waitq; /* for async buffered IO */
-	randomized_struct_fields_end
 };
 
 static inline bool is_sync_kiocb(struct kiocb *kiocb)
-- 
2.30.2


             reply	other threads:[~2022-08-12 22:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 22:56 Keith Busch [this message]
2022-08-12 23:00 ` [PATCH] fs: don't randomized kiocb fields Jens Axboe
2022-08-13  7:59 ` Christoph Hellwig
2022-08-13 14:33   ` Jens Axboe
2022-08-14 10:35 ` Matthew Wilcox
2022-08-15 14:49   ` Keith Busch

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=20220812225633.3287847-1-kbusch@fb.com \
    --to=kbusch@fb.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.