linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "J. R. Okajima" <hooanon05g@gmail.com>
To: Hugh Dickins <hughd@google.com>
Cc: "zhengbin (A)" <zhengbin13@huawei.com>,
	Matthew Wilcox <willy@infradead.org>,
	viro@zeniv.linux.org.uk, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, houtao1@huawei.com,
	yi.zhang@huawei.com
Subject: Re: [PATCH] tmpfs: use ida to get inode number
Date: Thu, 21 Nov 2019 20:40:26 +0900	[thread overview]
Message-ID: <32188.1574336426@jrobl> (raw)
In-Reply-To: <alpine.LSU.2.11.1911202026040.1825@eggly.anvils>

Hugh Dickins:
> Internally (in Google) we do rely on good tmpfs inode numbers more
> than on those of other get_next_ino() filesystems, and carry a patch
> to mm/shmem.c for it to use 64-bit inode numbers (and separate inode
> number space for each superblock) - essentially,
>
> =09ino =3D sbinfo->next_ino++;
> =09/* Avoid 0 in the low 32 bits: might appear deleted */
> =09if (unlikely((unsigned int)ino =3D=3D 0))
> =09=09ino =3D sbinfo->next_ino++;

I agree with that "per superblock inum space", but I don't see your
point.  How can you manage it fully?  I mean how can you decide whether
the new inum is in use or not?
For example,
- you create a file which is assigned inum#10.
- you or other people create and unlink over and over on the same tmpfs.
- then sbinfo->next_ino will become zero, skipped, ok.
- and then it will be 10.
I don't think you want to share the same inum by two inodes.

Moreover, SysV SHM uses tmpfs and shmget(2) overwrite inum internally.
It will be another seed of a similar problem.


J. R. Okajima



  parent reply	other threads:[~2019-11-21 11:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 14:23 [PATCH] tmpfs: use ida to get inode number zhengbin
2019-11-20 15:45 ` Matthew Wilcox
2019-11-21  2:36   ` zhengbin (A)
2019-11-21  4:52     ` Hugh Dickins
2019-11-21  6:45       ` zhengbin (A)
2019-11-21 19:53         ` Hugh Dickins
2019-11-22  1:23           ` zhengbin (A)
2019-11-22 22:13             ` Matthew Wilcox
2019-11-23  2:16               ` zhengbin (A)
2019-11-23  2:33                 ` Matthew Wilcox
2019-11-23  4:54                   ` Al Viro
2019-12-01  8:44               ` zhengbin (A)
2019-11-21 11:40       ` J. R. Okajima [this message]
2019-11-21 20:07         ` Hugh Dickins
2019-11-21  4:31   ` Al Viro

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=32188.1574336426@jrobl \
    --to=hooanon05g@gmail.com \
    --cc=houtao1@huawei.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --cc=yi.zhang@huawei.com \
    --cc=zhengbin13@huawei.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).