Patch "selftests/landlock: Fix fs_test build with old libc" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/landlock: Fix fs_test build with old libc

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-landlock-fix-fs_test-build-with-old-libc.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3a70dca5a02a09ceb22fc6b9e60bbbe180ea76d4
Author: Hu Yadi <hu.yadi@xxxxxxx>
Date:   Wed Jan 24 10:29:08 2024 +0800

    selftests/landlock: Fix fs_test build with old libc
    
    [ Upstream commit 40b7835e74e0383be308d528c5e0e41b3bf72ade ]
    
    One issue comes up while building selftest/landlock/fs_test on my side
    (gcc 7.3/glibc-2.28/kernel-4.19).
    
    gcc -Wall -O2 -isystem   fs_test.c -lcap -o selftests/landlock/fs_test
    fs_test.c:4575:9: error: initializer element is not constant
      .mnt = mnt_tmp,
             ^~~~~~~
    
    Signed-off-by: Hu Yadi <hu.yadi@xxxxxxx>
    Suggested-by: Jiao <jiaoxupo@xxxxxxx>
    Reviewed-by: Berlin <berlin@xxxxxxx>
    Link: https://lore.kernel.org/r/20240124022908.42100-1-hu.yadi@xxxxxxx
    Fixes: 04f9070e99a4 ("selftests/landlock: Add tests for pseudo filesystems")
    [mic: Factor out mount's data string and make mnt_tmp static]
    Signed-off-by: Mickaël Salaün <mic@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c
index 18e1f86a6234..fde1a96ef9f4 100644
--- a/tools/testing/selftests/landlock/fs_test.c
+++ b/tools/testing/selftests/landlock/fs_test.c
@@ -241,9 +241,11 @@ struct mnt_opt {
 	const char *const data;
 };
 
-const struct mnt_opt mnt_tmp = {
+#define MNT_TMP_DATA "size=4m,mode=700"
+
+static const struct mnt_opt mnt_tmp = {
 	.type = "tmpfs",
-	.data = "size=4m,mode=700",
+	.data = MNT_TMP_DATA,
 };
 
 static int mount_opt(const struct mnt_opt *const mnt, const char *const target)
@@ -4572,7 +4574,10 @@ FIXTURE_VARIANT(layout3_fs)
 /* clang-format off */
 FIXTURE_VARIANT_ADD(layout3_fs, tmpfs) {
 	/* clang-format on */
-	.mnt = mnt_tmp,
+	.mnt = {
+		.type = "tmpfs",
+		.data = MNT_TMP_DATA,
+	},
 	.file_path = file1_s1d1,
 };
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux