public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Ferry Toth <fntoth@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>,
	linux-btrfs@vger.kernel.org, Qu Wenruo <wqu@suse.com>
Subject: Re: Errors on newly created file system
Date: Thu, 24 Apr 2025 23:16:41 +0200	[thread overview]
Message-ID: <a0c57ce5-84f0-4534-9d34-d2bd0d305882@gmail.com> (raw)
In-Reply-To: <f32bd559-71c7-4d45-9af4-47a913eca63d@gmx.com>

Op 24-04-2025 om 22:49 schreef Qu Wenruo:
> 
> 
> 在 2025/4/25 05:41, Ferry Toth 写道:
>> Hi
>>
> [...]
>>>
>>>
>>> Except with newer mkfs.btrfs (I tested using 6.13) the files are 
>>> owned by the unprivileged user.
>>>
>>>
>>> The result is, the image will not boot correctly.
>>>
>>>
>> I found more about this issue here
>>
>> https://lore.kernel.org/yocto/ 
>> tRtu.1740682678597454399.5171@lists.yoctoproject.org/T/ 
>> #m5de0afa17d2c0f640e86ffe67e0d74aea467fd5b
>>
> Thanks for the report.
> 
> Just want to be sure, with pseudo emulating root environment, how does 
> it handle the file uid/gid?
> 
> Mkfs.btrfs uses the uid/gid reported from stat() system calls, thus if 
> pseudo doesn't change uid/gid reported from stat(), mkfs.btrfs will just 
> follow the result.

The change in mkfs.btrfs is reportedly:
"The important change is that previously mkfs.btrfs was
using lstat syscall to get file stats, but then it switched to nftw libc
function to do the same. Pseudo[3] however doesn't support this call -
it "knows" that it exists (at least nftw64), but there seems to be no
implementation."

So, as I understand, pseudo would hook into stats call, lookup in 
database and change uid/gid accordingly. But now there is only a stub.

Right now I am trying a patch for pseudo that implements nftw64. It 
triggers a rebuild for half my image, so that will takes another hour or 
so. I'll let you know how that goes.

This particular problem does seem to be more pseudo related.

> I guess it's possible for us to implement an idmap-like solution, but 
> I'd like to know how pseudo works first.
> 
> Thanks,
> Qu


  reply	other threads:[~2025-04-24 21:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-20 21:45 Errors on newly created file system Ferry Toth
2025-04-20 22:00 ` Qu Wenruo
2025-04-22 21:32   ` Ferry Toth
2025-04-22 22:00     ` Qu Wenruo
2025-04-23 16:06       ` Ferry Toth
2025-04-23 23:24         ` Qu Wenruo
2025-04-24 11:31           ` Ferry Toth
2025-04-24 20:11             ` Ferry Toth
2025-04-24 20:49               ` Qu Wenruo
2025-04-24 21:16                 ` Ferry Toth [this message]
2025-04-26 21:01                   ` Ferry Toth
2025-04-26 20:42           ` Ferry Toth

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=a0c57ce5-84f0-4534-9d34-d2bd0d305882@gmail.com \
    --to=fntoth@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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