mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-erofs@lists.ozlabs.org, Chao Yu <chao.yu@oppo.com>
Subject: Re: [PATCH] erofs: support idmapped mounts
Date: Tue, 17 May 2022 11:22:03 +0200	[thread overview]
Message-ID: <20220517092203.6dlcxynvpokqrfzg@wittgenstein> (raw)
In-Reply-To: <YoNnlpGBFm7dh6yD@B-P7TQMD6M-0146.local>

On Tue, May 17, 2022 at 05:15:02PM +0800, Gao Xiang wrote:
> Hi Christian,
> 
> On Tue, May 17, 2022 at 11:06:22AM +0200, Christian Brauner wrote:
> > On Tue, May 17, 2022 at 03:32:10PM +0800, Chao Yu wrote:
> > > This patch enables idmapped mounts for erofs, since all dedicated helpers
> > > for this functionality existsm, so, in this patch we just pass down the
> > > user_namespace argument from the VFS methods to the relevant helpers.
> > > 
> > > Simple idmap example on erofs image:
> > > 
> > > 1. mkdir dir
> > > 2. touch dir/file
> > > 3. mkfs.erofs erofs.img dir
> > > 4. mount -t erofs -o loop erofs.img  /mnt/erofs/
> > > 
> > > 5. ls -ln /mnt/erofs/
> > > total 0
> > > -rw-rw-r-- 1 1000 1000 0 May 17 15:26 file
> > > 
> > > 6. mount-idmapped --map-mount b:0:1001:1 /mnt/erofs/ /mnt/scratch_erofs/
> > > 
> > > 7. ls -ln /mnt/scratch_erofs/
> > > total 0
> > > -rw-rw-r-- 1 65534 65534 0 May 17 15:26 file
> > 
> > Your current example maps id 0 in the filesystem to id 1001 in the
> > mount. But since no files with id 0 exist in the filesystem you're
> > illustrating that unmapped ids are correctly reported as overflow{g,u}id.
> > 
> > I think what you'd rather want to show is something like this:
> > 
> > 5. ls -ln /mnt/erofs/
> > total 0
> > -rw-rw-r-- 1 1000 1000 0 May 17 15:26 file
> > 
> > 6. mount-idmapped --map-mount b:1000:1001:1 /mnt/erofs/ /mnt/scratch_erofs/
> > 
> > 7. ls -ln /mnt/scratch_erofs/
> > total 0
> > -rw-rw-r-- 1 1001 1001 0 May 17 15:26 file
> > 
> > where id 1000 in the filesystem maps to id 1001 in the mount.
> > 
> > > 
> > > Signed-off-by: Chao Yu <chao.yu@oppo.com>
> > > ---
> > 
> > Overall this is currently the smallest patch to support idmapped mounts.
> > 
> > Is erofs integrated with xfstests in any way?
> > For read-only filesystems we probably only need to verify that {g,u}id
> > are correctly reported. All the writable aspects are irrelevant.
> 
> Currently most generic xfstests test cases are unsuitable for erofs.
> 
> Instead we have regression testcases for EROFS specific since it needs
> to generate images with care,
>  https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/log/?h=experimental-tests
> 
> Also we have an erofsstress to do long time random stress workloads,
> https://github.com/erofs/erofsstress
> 
> But yeah, it's some awkward that fstests idmapped mount testcases may
> be unsuitable for EROFS for now. I will add some new testcases to build
> images and test for this behavior.
> 
> > 
> > Looks good,
> > Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
> 
> Thanks for your review!

Thanks for supporting this in erofs!
Christian

  reply	other threads:[~2022-05-17  9:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  7:32 Chao Yu
2022-05-17  8:00 ` Gao Xiang
2022-05-17  9:06 ` Christian Brauner
2022-05-17  9:15   ` Gao Xiang
2022-05-17  9:22     ` Christian Brauner [this message]
2022-05-17 10:32       ` Gao Xiang

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=20220517092203.6dlcxynvpokqrfzg@wittgenstein \
    --to=brauner@kernel.org \
    --cc=chao.yu@oppo.com \
    --cc=fsdevel@vger.kernel.org \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®