From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: Zorro Lang <zlang@redhat.com>
Cc: "fstests@vger.kernel.org" <fstests@vger.kernel.org>,
Christian Brauner <brauner@kernel.org>
Subject: Re: [PATCH v4 1/3] idmapped-mounts: Reset errno to zero before run_test
Date: Sat, 7 May 2022 13:56:04 +0000 [thread overview]
Message-ID: <627688B2.3050006@fujitsu.com> (raw)
In-Reply-To: <20220507133330.xxuw2x7buluhpnlu@zlang-mailbox>
on 2022/5/7 21:33, Zorro Lang wrote:
> On Sat, May 07, 2022 at 09:05:24PM +0800, Yang Xu wrote:
>> If we run case on old kernel that doesn't support mount_setattr and
>> then fail on our own function before call is_setgid/is_setuid function
>> to reset errno, run_test will print "Function not implement" error.
>>
>> We also check whether system support user namespace, so reset errno to
>> zero after userns check.
>>
>> Acked-by: Christian Brauner (Microsoft)<brauner@kernel.org>
>> Signed-off-by: Yang Xu<xuyang2018.jy@fujitsu.com>
>> ---
>
> This patchset bring in a new failure [1] on kernel 5.18.0-0.rc4+. Before I push,
> just confirm that is it as your expected, not a regression ?
No, it should all pass because I don't introduce umask or acl operations.
>
> Thanks,
> Zorro
>
> [1]
> # ./check generic/633
> FSTYP -- xfs (non-debug)
> PLATFORM -- Linux/x86_64 hp-xxxxxxx-xx 5.18.0-0.rc4.20220427git46cf2c613f4b10e.35.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 27 13:03:32 UTC 2022
> MKFS_OPTIONS -- -f /dev/sda3
> MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/sda3 /mnt/scratch
>
> generic/633 14s ... [failed, exit status 1]- output mismatch (see /root/git/xfstests/results//generic/633.out.bad)
> --- tests/generic/633.out 2022-04-29 23:07:23.547501513 +0800
> +++ /root/git/xfstests/results//generic/633.out.bad 2022-05-07 21:20:40.205852662 +0800
> @@ -1,2 +1,4 @@
> QA output created by 633
> Silence is golden
> +idmapped-mounts.c: 8244: setgid_create_idmapped - No such file or directory - failure: linkat
> +idmapped-mounts.c: 14437: run_test - Success - failure: create operations in directories with setgid bit set on idmapped mounts
It is a copy-paste error. It shoud use open_tree_fd in line 8243 as below:
if (linkat(tmpfile_fd, "", open_tree_fd, FILE3, AT_EMPTY_PATH))
Can you try replace t_dir1_fd with open_tree_fd for tmpfile permanent
in setgid_create_idmapped and setgid_create_idmapped_in_userns function?
Best Regards
Yang Xu
> ...
> (Run 'diff -u /root/git/xfstests/tests/generic/633.out /root/git/xfstests/results//generic/633.out.bad' to see the entire diff)
> Ran: generic/633
> Failures: generic/633
> Failed 1 of 1 tests
>
>> v3->v4: move this reset step after sys_has_usersn()
>> src/idmapped-mounts/idmapped-mounts.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/src/idmapped-mounts/idmapped-mounts.c b/src/idmapped-mounts/idmapped-mounts.c
>> index ce3f73be..2e94bf71 100644
>> --- a/src/idmapped-mounts/idmapped-mounts.c
>> +++ b/src/idmapped-mounts/idmapped-mounts.c
>> @@ -14232,6 +14232,8 @@ int main(int argc, char *argv[])
>> exit(EXIT_SUCCESS);
>> }
>> t_has_userns = sys_has_userns();
>> + /* don't copy ENOSYS errno to child process on older kernel */
>> + errno = 0;
>>
>> stash_overflowuid();
>> stash_overflowgid();
>> --
>> 2.31.1
>>
>
next prev parent reply other threads:[~2022-05-07 13:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-07 13:05 [PATCH v4 1/3] idmapped-mounts: Reset errno to zero before run_test Yang Xu
2022-05-07 13:05 ` [PATCH v4 2/3] idmapped-mounts: Add mknodat operation in setgid test Yang Xu
2022-05-07 13:05 ` [PATCH v4 3/3] idmapped-mounts: Add open with O_TMPFILE " Yang Xu
2022-05-07 13:33 ` [PATCH v4 1/3] idmapped-mounts: Reset errno to zero before run_test Zorro Lang
2022-05-07 13:56 ` xuyang2018.jy [this message]
2022-05-07 14:23 ` xuyang2018.jy
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=627688B2.3050006@fujitsu.com \
--to=xuyang2018.jy@fujitsu.com \
--cc=brauner@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=zlang@redhat.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