From: Chris Down <chris@chrisdown.name>
To: Amir Goldstein <amir73il@gmail.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Matthew Wilcox <willy@infradead.org>,
Jeff Layton <jlayton@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
kernel-team@fb.com
Subject: Re: [PATCH v2 2/2] tmpfs: Support 64-bit inums per-sb
Date: Thu, 2 Jan 2020 20:14:37 +0000 [thread overview]
Message-ID: <20200102201437.GB1181932@chrisdown.name> (raw)
In-Reply-To: <CAOQ4uxg_V_TCPrOZdF2gkGgmnqeWaamABSyVp8Prx6Y+=WdLBg@mail.gmail.com>
Amir Goldstein writes:
>> +config TMPFS_INODE64
>> + bool "Use 64-bit ino_t by default in tmpfs"
>> + depends on TMPFS && 64BIT
>> + default n
>> + help
>> + tmpfs has historically used only inode numbers as wide as an unsigned
>> + int. In some cases this can cause wraparound, potentially resulting in
>> + multiple files with the same inode number on a single device. This option
>> + makes tmpfs use the full width of ino_t by default, similarly to the
>> + inode64 mount option.
>> +
>> + tmpfs mounts that are used privately by the kernel and are not visible to
>> + users are unaffected.
>
>Admins won't know what the line above means and they shouldn't care.
>It adds no information, so better remove it.
Sure thing.
>> +
>> + /*
>> + * Showing inode{64,32} might be useful even if it's the system default,
>> + * since then people don't have to resort to checking both here and
>> + * /proc/config.gz to confirm 64-bit inums were successfully applied
>> + * (which may not even exist if IKCONFIG_PROC isn't enabled).
>> + *
>> + * We hide it when inode64 isn't the default and we are using 32-bit
>> + * inodes, since that probably just means the feature isn't even under
>> + * consideration.
>> + *
>> + * As such:
>> + *
>> + * +-----------------+-----------------+
>> + * | TMPFS_INODE64=y | TMPFS_INODE64=n |
>> + * +------------------+-----------------+-----------------+
>> + * | full_inums=true | show | show |
>> + * | full_inums=false | show | hide |
>> + * +------------------+-----------------+-----------------+
>> + *
>> + */
>> + if (IS_ENABLED(CONFIG_TMPFS_INODE64) || !sbinfo->full_inums)
>
>Condition does not match comment - should be || sbinfo->full_inums)
Good catch! Thanks.
>> @@ -3915,6 +3969,7 @@ int shmem_init_fs_context(struct fs_context *fc)
>> ctx->mode = 0777 | S_ISVTX;
>> ctx->uid = current_fsuid();
>> ctx->gid = current_fsgid();
>> + ctx->full_inums = IS_ENABLED(CONFIG_TMPFS_INODE64);
>>
>
>This is the wrong place for this - it is also being set for the kern_mount.
>Follow the lead of shmem_default_max_inodes.
Hmm, full_inums is intended to be simply ignored for SB_KERNMOUNT though, so it
seems harmless, but I agree maybe it makes the intent of the code clearer to
move it to a more specific place.
Thanks! I'll fix these up for v3.
prev parent reply other threads:[~2020-01-02 20:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-02 18:48 [PATCH v2 0/2] tmpfs: Reduce risk of inum overflow Chris Down
2020-01-02 18:49 ` [PATCH v2 1/2] tmpfs: Add per-superblock i_ino support Chris Down
2020-01-02 19:48 ` Amir Goldstein
2020-01-02 20:00 ` Chris Down
2020-01-02 20:08 ` Amir Goldstein
2020-01-02 18:50 ` [PATCH v2 2/2] tmpfs: Support 64-bit inums per-sb Chris Down
2020-01-02 20:07 ` Amir Goldstein
2020-01-02 20:14 ` Chris Down [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=20200102201437.GB1181932@chrisdown.name \
--to=chris@chrisdown.name \
--cc=amir73il@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=jlayton@kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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 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).