linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: akpm@linux-foundation.org, adobriyan@gmail.com
Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Chao Yu <chao@kernel.org>
Subject: [PATCH 2/2] proc: fix .s_blocksize and .s_blocksize_bits
Date: Tue, 31 Jan 2023 23:55:59 +0800	[thread overview]
Message-ID: <20230131155559.35800-2-chao@kernel.org> (raw)
In-Reply-To: <20230131155559.35800-1-chao@kernel.org>

procfs uses seq_file's operations to process IO, and seq_file
uses PAGE_SIZE as basic operating unit, so, fix to update
.s_blocksize and .s_blocksize_bits from 1024 and 10 to PAGE_SIZE
and PAGE_SHIFT.

Signed-off-by: Chao Yu <chao@kernel.org>
---
v2:
- fix to update blocksize to PAGE_SIZE pointed out by Alexey Dobriyan.
 fs/proc/root.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/proc/root.c b/fs/proc/root.c
index 3c2ee3eb1138..8bf5a9080adc 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -173,8 +173,8 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc)
 	/* User space would break if executables or devices appear on proc */
 	s->s_iflags |= SB_I_USERNS_VISIBLE | SB_I_NOEXEC | SB_I_NODEV;
 	s->s_flags |= SB_NODIRATIME | SB_NOSUID | SB_NOEXEC;
-	s->s_blocksize = 1024;
-	s->s_blocksize_bits = 10;
+	s->s_blocksize = PAGE_SIZE;
+	s->s_blocksize_bits = PAGE_SHIFT;
 	s->s_magic = PROC_SUPER_MAGIC;
 	s->s_op = &proc_sops;
 	s->s_time_gran = 1;
-- 
2.36.1


  reply	other threads:[~2023-01-31 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 15:55 [PATCH 1/2] proc: fix to check name length in proc_lookup_de() Chao Yu
2023-01-31 15:55 ` Chao Yu [this message]
2023-02-01 13:01 ` Chao Yu
2023-02-02 23:41   ` Andrew Morton
2023-02-05 12:21     ` Alexey Dobriyan
2023-02-11  1:22       ` Chao Yu
2023-02-11  1:13     ` Chao Yu

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=20230131155559.35800-2-chao@kernel.org \
    --to=chao@kernel.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).