All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Doucha <mdoucha@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/3] lib: Add proper filesystem skiplist
Date: Wed, 10 Mar 2021 17:34:03 +0100	[thread overview]
Message-ID: <b3391506-259b-1376-2c51-4d2a1557a44a@suse.cz> (raw)
In-Reply-To: <YEjyLBZQ+D1CHqnq@rei.lan>

On 10. 03. 21 17:22, Cyril Hrubis wrote:
> Hi!
>>> +static int has_kernel_support(const char *fs_type, const char *const *skiplist)
>>>  {
>>>  	static int fuse_supported = -1;
>>>  	const char *tmpdir = getenv("TMPDIR");
>>>  	char buf[128];
>>>  	int ret;
>>>  
>>> +	if (tst_fs_in_skiplist(fs_type, skiplist))
>>> +		return 0;
>>> +
>>>  	if (!tmpdir)
>>>  		tmpdir = "/tmp";
>>>  
>>> @@ -84,26 +105,24 @@ static int has_kernel_support(const char *fs_type, int flags)
>>>  		return 0;
>>>  	}
>>>  
>>> -	if (flags & TST_FS_SKIP_FUSE) {
>>> -		tst_res(TINFO, "Skipping FUSE as requested by the test");
>>> +	if (tst_fs_in_skiplist("fuse", skiplist))
>>>  		return 0;
>>> -	}
>>>  
>>>  	tst_res(TINFO, "FUSE does support %s", fs_type);
>>>  	return 1;
>>>  }
>>
>> I don't think that has_kernel_support() should look at the skiplist at
>> all. The entire skiplist logic should be handled in
>> tst_get_supported_fs_types(). But has_kernel_support() could return
>> different (non-zero) values for native support and for FUSE support.
> 
> I do not agree, that would add more complexity to an internal function
> that is not exported outside the library.

Your patchset adds complexity to tst_fs_is_supported() which is a public
wrapper of has_kernel_support(), even though it's only used indirectly
in shell tests. Some tests might use that function directly in the
future so let's make the interface cleaner, not hairier.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

  reply	other threads:[~2021-03-10 16:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 12:26 [LTP] [PATCH 0/3] Add proper filesystem skiplist Cyril Hrubis
2021-03-10 12:26 ` [LTP] [PATCH 1/3] lib: " Cyril Hrubis
2021-03-10 12:58   ` Petr Vorel
2021-03-10 14:28     ` Cyril Hrubis
2021-03-10 15:39       ` Petr Vorel
2021-03-10 16:19   ` Martin Doucha
2021-03-10 16:22     ` Cyril Hrubis
2021-03-10 16:34       ` Martin Doucha [this message]
2021-03-11  8:39         ` Li Wang
2021-03-10 12:26 ` [LTP] [PATCH 2/3] lib: tst_fs_type change fs names to lowercase Cyril Hrubis
2021-03-10 12:26 ` [LTP] [PATCH 3/3] lib: Apply the skip_filesystems to rest of test as well Cyril Hrubis
2021-03-10 12:42 ` [LTP] [PATCH 0/3] Add proper filesystem skiplist Petr Vorel
2021-03-10 12:55 ` Jan Stancek
2021-03-10 14:14   ` Cyril Hrubis
2021-03-10 16:01     ` Jan Stancek

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=b3391506-259b-1376-2c51-4d2a1557a44a@suse.cz \
    --to=mdoucha@suse.cz \
    --cc=ltp@lists.linux.it \
    /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.