All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: Wei Gao <wegao@suse.com>, Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/2] mount_setattr01: add open_tree_attr variant
Date: Fri, 29 Aug 2025 14:06:01 +0200	[thread overview]
Message-ID: <191532ce-b780-4f71-a31f-e6dbbb5acd5e@suse.com> (raw)
In-Reply-To: <aLDhgFRA8ppAmYlH@localhost>

Hi!

On 8/29/25 1:08 AM, Wei Gao wrote:
>> -	otfd = (int)TST_RET;
>> +	if (tst_variant)
>> +		otfd = open_tree_variant1(attr);
>> +	else
>> +		otfd = open_tree_variant2(attr);
> I am not sure this is perfect way loop the function, add function point into struct tcase
> is better in my opinion.
That's actually an overkill, considering we already have one variable 
deciding what variant we are going to execute. To add a pointer in tcase 
it means to define a type, declare a pointer, initialize it and to use it.
>>   
>> -	TST_EXP_PASS_SILENT(mount_setattr(otfd, "", AT_EMPTY_PATH, &attr, sizeof(attr)),
>> -		"%s set", tc->name);
>> -	if (!TST_PASS)
>> -		goto out1;
>> +	if (otfd == -1)
>> +		goto out2;
>>   
>>   	TST_EXP_PASS_SILENT(move_mount(otfd, "", AT_FDCWD, OT_MNTPOINT, MOVE_MOUNT_F_EMPTY_PATH));
> I suppose we can also check mounts option take effect or not like:
> https://patchwork.ozlabs.org/project/ltp/patch/20250828225157.982-1-wegao@suse.com/

Also this would require a map between mount attrs and strings which are 
going to be converted back again. It would make sense if we were testing 
move_mount, but we already have the attr information via tcase and statvfs.

- Andrea

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2025-08-29 12:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28 13:11 [LTP] [PATCH 0/2] open_tree_attr syscall coverage Andrea Cervesato
2025-08-28 13:11 ` [LTP] [PATCH 1/2] Add open_tree_attr fallback Andrea Cervesato
2025-08-28 13:11 ` [LTP] [PATCH 2/2] mount_setattr01: add open_tree_attr variant Andrea Cervesato
2025-08-28 23:08   ` Wei Gao via ltp
2025-08-29  9:31     ` Cyril Hrubis
2025-08-29 12:06       ` Andrea Cervesato via ltp
2025-08-29 12:55         ` Cyril Hrubis
2025-09-01 10:28           ` Andrea Cervesato via ltp
2025-09-01 15:48             ` Cyril Hrubis
2025-08-29 12:06     ` Andrea Cervesato via ltp [this message]
2025-08-29 12:58   ` Cyril Hrubis

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=191532ce-b780-4f71-a31f-e6dbbb5acd5e@suse.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=andrea.cervesato@suse.de \
    --cc=wegao@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 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.