All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Dave Chinner <david@fromorbit.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	linux-xfs <linux-xfs@vger.kernel.org>,
	overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: Question about XFS_MAXINUMBER
Date: Sat, 17 Mar 2018 09:56:19 +0200	[thread overview]
Message-ID: <CAOQ4uxh0H8mbbAZt0MEdLGRY-8Aqg2c9UFM56-KL2b90fLYCFQ@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegvoFwEVP6ijUW3iUpfc4_2xTiw=AfE8P6O6VDhrGiDEqw@mail.gmail.com>

On Sat, Mar 17, 2018 at 7:40 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Fri, Mar 16, 2018 at 11:24 PM, Dave Chinner <david@fromorbit.com> wrote:
>> On Fri, Mar 16, 2018 at 04:05:22PM +0200, Amir Goldstein wrote:
>>> Hi guys,
>>>
>>> I am trying to get a lower bound for unused inode number MSB on
>>> a mounted xfs super block, so I can publish it on struct super_block.
>>
>> Sorry, what?
>>
>> The inode number is owned by the filesystem - nobody should be
>> touching it or making assumptions they can screw with it in any way.
>>

Let me clarify with the simplest example:

With overlay of 2 layers, lower and upper on 2 different xfs fs
assuming that stat(2) from xfs will not be using the 63 MSB:

On stat(2) of an overlay upper inode we want to return:
  st_dev = <overlay anon bdev>
  st_ino = <real upper st_ino>

On stat(2) of an overlay lower inode we want to return:
  st_dev = <overlay anon bdev>
  st_ino = <real lower st_ino> | 1 << 63

Now for ext4 this is always safe to do and we find that automatically
due to the fact that ext4 uses the default encode_fh generic 32bit
inode encoding.

For xfs this should also be safe, but we don't want to whitelist xfs
by name/magic, so we want xfs to publish the max amount of bits
exposed to user with stat(2)/getdents(3).

Recently, I became aware of an nfsd use case that also looks
at inode->i_ino, so we may want to also be able to assume
max_ino_bits also applies to inode->i_ino, but if you tell us to
stay clear of inode->i_ino, then we can always use stat.st_ino.

Thanks,
Amir.

  reply	other threads:[~2018-03-17  7:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 14:05 Question about XFS_MAXINUMBER Amir Goldstein
2018-03-16 17:59 ` Amir Goldstein
2018-03-16 22:24 ` Dave Chinner
2018-03-17  5:40   ` Miklos Szeredi
2018-03-17  7:56     ` Amir Goldstein [this message]
2018-03-17 21:28       ` Dave Chinner
2018-03-18  6:21         ` Amir Goldstein
2018-03-18 23:02           ` Dave Chinner
2018-03-19  4:03             ` Amir Goldstein
2018-03-19  8:42               ` Miklos Szeredi
2018-03-20  1:47               ` Dave Chinner
2018-03-20  6:29                 ` Amir Goldstein
2018-03-20  8:04                   ` Ian Kent
2018-03-20  8:57                     ` Amir Goldstein
2018-03-20 10:18                       ` Ian Kent
2018-03-20  9:20                     ` Miklos Szeredi
2018-03-20 13:08                   ` Dave Chinner
2018-03-20  9:32                 ` Miklos Szeredi
2018-03-17  8:04     ` Dave Chinner
2018-03-17  8:24       ` Amir Goldstein

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=CAOQ4uxh0H8mbbAZt0MEdLGRY-8Aqg2c9UFM56-KL2b90fLYCFQ@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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.