public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] file_attr02: Add XFS kernel config requirement
@ 2025-10-24 12:56 Anders Roxell
  2025-10-24 13:30 ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Anders Roxell @ 2025-10-24 12:56 UTC (permalink / raw)
  To: ltp; +Cc: benjamin.copeland, dan.carpenter

The file_attr02 test requires XFS filesystem support to properly
test the FS_IOC_FSSETXATTR ioctl with project quotas. Add the
XFS kernel configuration requirement to ensure the test can run
on systems with XFS support either built-in or as a module.

Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 testcases/kernel/syscalls/file_attr/file_attr02.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/file_attr/file_attr02.c b/testcases/kernel/syscalls/file_attr/file_attr02.c
index f6625985a514..0ad57177078b 100644
--- a/testcases/kernel/syscalls/file_attr/file_attr02.c
+++ b/testcases/kernel/syscalls/file_attr/file_attr02.c
@@ -18,6 +18,11 @@
 #define BLOCKS 128
 #define PROJID 16
 
+static const char *kconfigs[] = {
+	"CONFIG_XFS_FS=y | CONFIG_XFS_FS=m",
+	NULL
+};
+
 static int fd = -1;
 static int dfd = -1;
 static struct fsxattr xattr;
@@ -105,5 +110,6 @@ static struct tst_test test = {
 	.bufs = (struct tst_buffers []) {
 		{&attr, .size = sizeof(struct file_attr)},
 		{}
-	}
+	},
+	.needs_kconfigs = kconfigs,
 };
-- 
2.51.0


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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] file_attr02: Add XFS kernel config requirement
  2025-10-24 12:56 [LTP] [PATCH] file_attr02: Add XFS kernel config requirement Anders Roxell
@ 2025-10-24 13:30 ` Petr Vorel
  2025-10-24 17:25   ` Dan Carpenter
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2025-10-24 13:30 UTC (permalink / raw)
  To: Anders Roxell; +Cc: benjamin.copeland, dan.carpenter, ltp

> The file_attr02 test requires XFS filesystem support to properly
> test the FS_IOC_FSSETXATTR ioctl with project quotas. Add the
> XFS kernel configuration requirement to ensure the test can run
> on systems with XFS support either built-in or as a module.

So you have problem on the kernel with CONFIG_XFS_FS=y?
I wonder why tst_get_supported_fs_types() from lib/tst_supported_fs_types.c did
not detect it. Could you please post whole output?

Because if code in struct tst_test.filesystems does not work, many tests would
be affected with this setup. I'm probably missing something, but I'd prefer to
fix the detection in the library than force config (we don't have any CONFIG_.*_FS
in testcases/).

> Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  testcases/kernel/syscalls/file_attr/file_attr02.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

> diff --git a/testcases/kernel/syscalls/file_attr/file_attr02.c b/testcases/kernel/syscalls/file_attr/file_attr02.c
> index f6625985a514..0ad57177078b 100644
> --- a/testcases/kernel/syscalls/file_attr/file_attr02.c
> +++ b/testcases/kernel/syscalls/file_attr/file_attr02.c
> @@ -18,6 +18,11 @@
>  #define BLOCKS 128
>  #define PROJID 16

> +static const char *kconfigs[] = {
> +	"CONFIG_XFS_FS=y | CONFIG_XFS_FS=m",
> +	NULL
> +};
> +
>  static int fd = -1;
>  static int dfd = -1;
>  static struct fsxattr xattr;
> @@ -105,5 +110,6 @@ static struct tst_test test = {
>  	.bufs = (struct tst_buffers []) {
>  		{&attr, .size = sizeof(struct file_attr)},
>  		{}
> -	}
> +	},
> +	.needs_kconfigs = kconfigs,

very nit: we usually use anonymous definition here, instead creating static
variable kconfigs[].

Kind regards,
Petr

>  };

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] file_attr02: Add XFS kernel config requirement
  2025-10-24 13:30 ` Petr Vorel
@ 2025-10-24 17:25   ` Dan Carpenter
  2025-10-27  9:21     ` Cyril Hrubis
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2025-10-24 17:25 UTC (permalink / raw)
  To: Petr Vorel; +Cc: benjamin.copeland, ltp

On Fri, Oct 24, 2025 at 03:30:35PM +0200, Petr Vorel wrote:
> > The file_attr02 test requires XFS filesystem support to properly
> > test the FS_IOC_FSSETXATTR ioctl with project quotas. Add the
> > XFS kernel configuration requirement to ensure the test can run
> > on systems with XFS support either built-in or as a module.
> 
> So you have problem on the kernel with CONFIG_XFS_FS=y?

No, on systems with CONFIG_XFS_FS=n.  We do have the utilities
installed and FUSE_FS enabled, but the test says XFS is not
supported.

tst_supported_fs_types.c:129: TINFO: Filesystem xfs is not supported

The log file is here:
https://storage.tuxsuite.com/public/linaro/lkft/tests/340jmxk7fPGUn5zJbqsn4Chrs88/logs.txt

Both file_attr02 and file_attr03 fail.

> I wonder why tst_get_supported_fs_types() from lib/tst_supported_fs_types.c did
> not detect it. Could you please post whole output?
> 
> Because if code in struct tst_test.filesystems does not work, many tests would
> be affected with this setup. I'm probably missing something, but I'd prefer to
> fix the detection in the library than force config (we don't have any CONFIG_.*_FS
> in testcases/).
> 

That's a fair point.  I'm not really very familiar with how LTP works.

On the other hand, even if we fixed the LTP framework to not run tests
on unsupported filesystems, we might want to still fix it in case someone
just ran it with kirk

./tools/kirk/kirk/kirk -c ./testcases/kernel/syscalls/file_attr/file_attr02

or even just directly `./file_attr02`

regards,
dan carpenter

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] file_attr02: Add XFS kernel config requirement
  2025-10-24 17:25   ` Dan Carpenter
@ 2025-10-27  9:21     ` Cyril Hrubis
  2025-10-27 14:32       ` Anders Roxell
  0 siblings, 1 reply; 8+ messages in thread
From: Cyril Hrubis @ 2025-10-27  9:21 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: ltp, benjamin.copeland

Hi!
> > I wonder why tst_get_supported_fs_types() from lib/tst_supported_fs_types.c did
> > not detect it. Could you please post whole output?
> > 
> > Because if code in struct tst_test.filesystems does not work, many tests would
> > be affected with this setup. I'm probably missing something, but I'd prefer to
> > fix the detection in the library than force config (we don't have any CONFIG_.*_FS
> > in testcases/).

I think that we have a but in the test library, it looks like we do not
check for the kernel support if we have only one filesystem defined in
the tst_test.filesystems.

The problem is that we are trying to avoid formatting and mounting the
filesystem for each test iteration (if -i 10 is passed) but that means
that we skip the filesystem kernel support. We only check for mkfs in
the setup and prepare the device.

This should fix it:

diff --git a/lib/tst_test.c b/lib/tst_test.c
index b8894f782..d49f34623 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1530,6 +1530,10 @@ static void do_setup(int argc, char *argv[])
                tdev.fs_type = default_fs_type();

                if (!tst_test->all_filesystems && count_fs_descs() <= 1) {
+
+                       if (!tst_fs_is_supported(tdev.fs_type))
+                               tst_brk(TCONF, "The %s filesystem is not supported", tdev.fs_type);
+
                        if (tst_test->filesystems && tst_test->filesystems->mkfs_ver)
                                tst_check_cmd(tst_test->filesystems->mkfs_ver, 1);


-- 
Cyril Hrubis
chrubis@suse.cz

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] file_attr02: Add XFS kernel config requirement
  2025-10-27  9:21     ` Cyril Hrubis
@ 2025-10-27 14:32       ` Anders Roxell
  2025-10-27 15:11         ` Cyril Hrubis
  0 siblings, 1 reply; 8+ messages in thread
From: Anders Roxell @ 2025-10-27 14:32 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp, Dan Carpenter, benjamin.copeland

On Mon, 27 Oct 2025 at 10:22, Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Hi!
> > > I wonder why tst_get_supported_fs_types() from lib/tst_supported_fs_types.c did
> > > not detect it. Could you please post whole output?
> > >
> > > Because if code in struct tst_test.filesystems does not work, many tests would
> > > be affected with this setup. I'm probably missing something, but I'd prefer to
> > > fix the detection in the library than force config (we don't have any CONFIG_.*_FS
> > > in testcases/).
>
> I think that we have a but in the test library, it looks like we do not
> check for the kernel support if we have only one filesystem defined in
> the tst_test.filesystems.
>
> The problem is that we are trying to avoid formatting and mounting the
> filesystem for each test iteration (if -i 10 is passed) but that means
> that we skip the filesystem kernel support. We only check for mkfs in
> the setup and prepare the device.
>
> This should fix it:

Indeed, this fixed the issue I tried it, for both file_attr02 and file_attr03.

Will you create a patch or do you want me to create one?

Cheers,
Anders

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] file_attr02: Add XFS kernel config requirement
  2025-10-27 14:32       ` Anders Roxell
@ 2025-10-27 15:11         ` Cyril Hrubis
  2025-10-27 15:19           ` Dan Carpenter
  0 siblings, 1 reply; 8+ messages in thread
From: Cyril Hrubis @ 2025-10-27 15:11 UTC (permalink / raw)
  To: Anders Roxell; +Cc: ltp, Dan Carpenter, benjamin.copeland

Hi!
> Indeed, this fixed the issue I tried it, for both file_attr02 and file_attr03.
> 
> Will you create a patch or do you want me to create one?

Just send the patch with your Tested-by: thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] file_attr02: Add XFS kernel config requirement
  2025-10-27 15:11         ` Cyril Hrubis
@ 2025-10-27 15:19           ` Dan Carpenter
  2025-10-30 18:24             ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2025-10-27 15:19 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp, benjamin.copeland

On Mon, Oct 27, 2025 at 04:11:22PM +0100, Cyril Hrubis wrote:
> Hi!
> > Indeed, this fixed the issue I tried it, for both file_attr02 and file_attr03.
> > 
> > Will you create a patch or do you want me to create one?
> 
> Just send the patch with your Tested-by: thanks.
> 

Since you're the author we would need your Signed-off-by as well.

regards,
dan carpenter


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH] file_attr02: Add XFS kernel config requirement
  2025-10-27 15:19           ` Dan Carpenter
@ 2025-10-30 18:24             ` Petr Vorel
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2025-10-30 18:24 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: benjamin.copeland, ltp

Hi all,

because Cyril's library fix got merged this should not be needed, right?
https://github.com/linux-test-project/ltp/commit/5e1e0e2d81e564df09542b7caa2a66928c05dd3a

Kind regards,
Petr

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-10-30 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 12:56 [LTP] [PATCH] file_attr02: Add XFS kernel config requirement Anders Roxell
2025-10-24 13:30 ` Petr Vorel
2025-10-24 17:25   ` Dan Carpenter
2025-10-27  9:21     ` Cyril Hrubis
2025-10-27 14:32       ` Anders Roxell
2025-10-27 15:11         ` Cyril Hrubis
2025-10-27 15:19           ` Dan Carpenter
2025-10-30 18:24             ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox