{"id":2215887,"url":"http://patchwork.ozlabs.org/api/patches/2215887/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260325-ioctl_getlbmd01-v1-2-00dc526e326f@suse.com/","project":{"id":59,"url":"http://patchwork.ozlabs.org/api/projects/59/?format=json","name":"Linux Test Project development","link_name":"ltp","list_id":"ltp.lists.linux.it","list_email":"ltp@lists.linux.it","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260325-ioctl_getlbmd01-v1-2-00dc526e326f@suse.com>","list_archive_url":null,"date":"2026-03-25T14:19:11","name":"[2/2] Add new test ioctl_getlbmd01","commit_ref":null,"pull_url":null,"state":"needs-review-ack","archived":false,"hash":"075d6085fa2809a18986e657eb20d09ad4130745","submitter":{"id":83220,"url":"http://patchwork.ozlabs.org/api/people/83220/?format=json","name":"Andrea Cervesato","email":"andrea.cervesato@suse.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260325-ioctl_getlbmd01-v1-2-00dc526e326f@suse.com/mbox/","series":[{"id":497452,"url":"http://patchwork.ozlabs.org/api/series/497452/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=497452","date":"2026-03-25T14:19:10","name":"New test for ioctl(FS_IOC_GETLBMD_CAP) feature","version":1,"mbox":"http://patchwork.ozlabs.org/series/497452/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2215887/comments/","check":"success","checks":"http://patchwork.ozlabs.org/api/patches/2215887/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=uzOJW7nW;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.de\n header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=fxWwh0yd;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa\n header.b=0+9yOEO1;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=UGrIp9tF;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=213.254.12.146; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)","smtp-out1.suse.de;\n dkim=pass header.d=suse.de header.s=susede2_rsa header.b=0+9yOEO1;\n dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=UGrIp9tF"],"Received":["from picard.linux.it (picard.linux.it [213.254.12.146])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgpvM2399z1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 01:19:43 +1100 (AEDT)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 22A473E5521\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 15:19:41 +0100 (CET)","from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 352343E2FED\n for <ltp@lists.linux.it>; Wed, 25 Mar 2026 15:19:25 +0100 (CET)","from smtp-out1.suse.de (smtp-out1.suse.de\n [IPv6:2a07:de40:b251:101:10:150:64:1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 80577602156\n for <ltp@lists.linux.it>; Wed, 25 Mar 2026 15:19:24 +0100 (CET)","from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out1.suse.de (Postfix) with ESMTPS id 6AD204D24C;\n Wed, 25 Mar 2026 14:19:12 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 467D644441;\n Wed, 25 Mar 2026 14:19:12 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id oBF2D+Duw2nQPQAAD6G6ig\n (envelope-from <andrea.cervesato@suse.de>); Wed, 25 Mar 2026 14:19:12 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1774448353;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=ReMdblYJN7A8qt/5tEzOIi7nXDRi7jDvU9P6NrlVoLY=;\n b=uzOJW7nWUhTq3Nj1ZK26pxwYC73lcZcuR0e0AmC8WuNYI/CWyw8Ru0C7KgoW51ecv0TYqN\n a0s+oXap8zvrYiL2FZfZJoPmcPE2fd8lWaybTSmcfnaPvsrXAQz7qRmw5GKsMn8S7rFUVJ\n 5K+vlpNsiXqhUVkSehinUEpM+JFxmL0=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1774448353;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=ReMdblYJN7A8qt/5tEzOIi7nXDRi7jDvU9P6NrlVoLY=;\n b=fxWwh0ydlaUoj8Bv2HXkOk+qOZ49ETyJMN+ysHXGbdWvNg5WXf6BZoXIliufbvQzESvxLH\n zQ8JZtMD8Zuy55DQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1774448352;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=ReMdblYJN7A8qt/5tEzOIi7nXDRi7jDvU9P6NrlVoLY=;\n b=0+9yOEO1eiz+iYGVH6MAp6+fvYP0+t9hQW3V43qDnbrc8Afix6d/nZUD7o7SWOGtIh0uhq\n 1iGIiiU1E7deXD82K0JrzY3XyU4iShRexh1JgayspvzjWS8GjM81npn49/dpQ/cXHcU30G\n chY+nnpkFTpigLiX1OEjCVPZRQgrDPM=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1774448352;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=ReMdblYJN7A8qt/5tEzOIi7nXDRi7jDvU9P6NrlVoLY=;\n b=UGrIp9tFcl1Hb2KHcYGYlaLReP1xlT2vob8Ux3Byw5E3rkPHTEE2odpwRzISnJ4Yx6Upa3\n q5xmK81fhMZcbfCw=="],"From":"Andrea Cervesato <andrea.cervesato@suse.de>","Date":"Wed, 25 Mar 2026 15:19:11 +0100","MIME-Version":"1.0","Message-Id":"<20260325-ioctl_getlbmd01-v1-2-00dc526e326f@suse.com>","References":"<20260325-ioctl_getlbmd01-v1-0-00dc526e326f@suse.com>","In-Reply-To":"<20260325-ioctl_getlbmd01-v1-0-00dc526e326f@suse.com>","To":"Linux Test Project <ltp@lists.linux.it>","X-Mailer":"b4 0.14.2","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1774448351; l=4136;\n i=andrea.cervesato@suse.com; s=20251210; h=from:subject:message-id;\n bh=cg8VeVDI8wCZ/yr2HZjao+XKWM9bInwz+oLjHA5xgjM=;\n b=E6z8HzhFUysn1q4hznMhAfC+JBXJs3zPyhPI5rLoGllDa49tMrRcNMoVFN59QD9TA8qvCJmbQ\n 0Fzdqk6NTW2AEIvGhcne19EbG83gQLHVG9/rIH8ghHAelsln+o+r/UD","X-Developer-Key":"i=andrea.cervesato@suse.com; a=ed25519;\n pk=zKY+6GCauOiuHNZ//d8PQ/UL4jFCTKbXrzXAOQSLevI=","X-Spamd-Result":"default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-1.000];\n R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[];\n RCVD_TLS_ALL(0.00)[];\n DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from];\n RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n RCVD_VIA_SMTP_AUTH(0.00)[];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n MIME_TRACE(0.00)[0:+];\n RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];\n RCPT_COUNT_TWO(0.00)[2];\n URIBL_BLOCKED(0.00)[suse.de:dkim,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];\n FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];\n TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]","X-Rspamd-Action":"no action","X-Spam-Score":"-4.51","X-Spam-Level":"","X-Rspamd-Server":"rspamd1.dmz-prg2.suse.org","X-Rspamd-Queue-Id":"6AD204D24C","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-2.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-2.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"[LTP] [PATCH 2/2] Add new test ioctl_getlbmd01","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"},"content":"From: Andrea Cervesato <andrea.cervesato@suse.com>\n\nVerify :manpage:`ioctl(2)` with FS_IOC_GETLBMD_CAP on block devices.\n\n- fill struct logical_block_metadata_cap with non-zero pattern, call\n  FS_IOC_GETLBMD_CAP on a block device without integrity support\n  and verify the kernel zeroed out all fields\n- call FS_IOC_GETLBMD_CAP on a regular file and verify it fails\n  with ENOTTY\n\nSigned-off-by: Andrea Cervesato <andrea.cervesato@suse.com>\n---\n runtest/syscalls                                  |  2 +\n testcases/kernel/syscalls/ioctl/.gitignore        |  1 +\n testcases/kernel/syscalls/ioctl/ioctl_getlbmd01.c | 84 +++++++++++++++++++++++\n 3 files changed, 87 insertions(+)","diff":"diff --git a/runtest/syscalls b/runtest/syscalls\nindex 6ba0227a87f30e68e473c9019a6e6acc224738d9..e94a9cb58a1563dc15f26a16db480c8cac468375 100644\n--- a/runtest/syscalls\n+++ b/runtest/syscalls\n@@ -624,6 +624,8 @@ ioctl_ficlonerange01 ioctl_ficlonerange01\n ioctl_ficlonerange02 ioctl_ficlonerange02\n ioctl_fiemap01 ioctl_fiemap01\n \n+ioctl_getlbmd01 ioctl_getlbmd01\n+\n ioctl_pidfd01 ioctl_pidfd01\n ioctl_pidfd02 ioctl_pidfd02\n ioctl_pidfd03 ioctl_pidfd03\ndiff --git a/testcases/kernel/syscalls/ioctl/.gitignore b/testcases/kernel/syscalls/ioctl/.gitignore\nindex dac4583fa7c05a4cdd937e86bd8f935dd15aebc8..63765dea61a795aac01e5b6b14996e441b56d3e3 100644\n--- a/testcases/kernel/syscalls/ioctl/.gitignore\n+++ b/testcases/kernel/syscalls/ioctl/.gitignore\n@@ -30,6 +30,7 @@\n /ioctl_ficlonerange01\n /ioctl_ficlonerange02\n /ioctl_fiemap01\n+/ioctl_getlbmd01\n /ioctl_pidfd01\n /ioctl_pidfd02\n /ioctl_pidfd03\ndiff --git a/testcases/kernel/syscalls/ioctl/ioctl_getlbmd01.c b/testcases/kernel/syscalls/ioctl/ioctl_getlbmd01.c\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..56622977fa949e47ffaaf7403e1f266768366878\n--- /dev/null\n+++ b/testcases/kernel/syscalls/ioctl/ioctl_getlbmd01.c\n@@ -0,0 +1,84 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (c) 2026 Andrea Cervesato <andrea.cervesato@suse.com>\n+ */\n+\n+/*\\\n+ * Verify :manpage:`ioctl(2)` with FS_IOC_GETLBMD_CAP on block devices.\n+ *\n+ * - fill struct logical_block_metadata_cap with non-zero pattern, call\n+ *   FS_IOC_GETLBMD_CAP on a block device without integrity support\n+ *   and verify the kernel zeroed out all fields\n+ * - call FS_IOC_GETLBMD_CAP on a regular file and verify it fails\n+ *   with ENOTTY\n+ */\n+\n+#include <sys/ioctl.h>\n+#include \"tst_test.h\"\n+#include \"lapi/fs.h\"\n+\n+static int dev_fd = -1;\n+static int file_fd = -1;\n+\n+static struct logical_block_metadata_cap *meta_cap;\n+\n+static void run(void)\n+{\n+\tmemset(meta_cap, 0xff, sizeof(*meta_cap));\n+\n+\tTST_EXP_PASS(ioctl(dev_fd, FS_IOC_GETLBMD_CAP, meta_cap),\n+\t\t\"FS_IOC_GETLBMD_CAP on block device\");\n+\n+\tif (!TST_PASS)\n+\t\treturn;\n+\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_flags, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_interval, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_size, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_opaque_size, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_opaque_offset, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_pi_size, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_pi_offset, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_guard_tag_type, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_app_tag_size, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_ref_tag_size, 0);\n+\tTST_EXP_EQ_LU(meta_cap->lbmd_storage_tag_size, 0);\n+\n+\tTST_EXP_FAIL(ioctl(file_fd, FS_IOC_GETLBMD_CAP, meta_cap), ENOTTY,\n+\t\t\"FS_IOC_GETLBMD_CAP on regular file\");\n+}\n+\n+static void setup(void)\n+{\n+\tdev_fd = SAFE_OPEN(tst_device->dev, O_RDONLY);\n+\n+\tSAFE_TOUCH(\"testfile\", 0644, NULL);\n+\tfile_fd = SAFE_OPEN(\"testfile\", O_RDONLY);\n+}\n+\n+static void cleanup(void)\n+{\n+\tif (file_fd != -1)\n+\t\tSAFE_CLOSE(file_fd);\n+\n+\tif (dev_fd != -1)\n+\t\tSAFE_CLOSE(dev_fd);\n+}\n+\n+static struct tst_test test = {\n+\t.test_all = run,\n+\t.setup = setup,\n+\t.cleanup = cleanup,\n+\t.needs_device = 1,\n+\t.needs_root = 1,\n+\t.needs_tmpdir = 1,\n+\t.min_kver = \"6.17\",\n+\t.needs_kconfigs = (const char *[]) {\n+\t\t\"CONFIG_BLK_DEV_INTEGRITY=y\",\n+\t\tNULL,\n+\t},\n+\t.bufs = (struct tst_buffers[]) {\n+\t\t{&meta_cap, .size = sizeof(*meta_cap)},\n+\t\t{},\n+\t},\n+};\n","prefixes":["2/2"]}