From patchwork Thu Dec 15 08:45:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16760 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99B1CC4167B for ; Thu, 15 Dec 2022 08:45:50 +0000 (UTC) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mx.groups.io with SMTP id smtpd.web10.128332.1671093949097219230 for ; Thu, 15 Dec 2022 00:45:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MJv7Uxr4; spf=pass (domain: gmail.com, ip: 209.85.214.171, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f171.google.com with SMTP id s7so6134676plk.5 for ; Thu, 15 Dec 2022 00:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kNv7AlLlFFJnRtks9uAPECMxkxEo1RxwuULQzYu1lYM=; b=MJv7Uxr4ep4Ol/gYnmrclIfhrizILi7lX5wtiL8c78hUggxUqOyVZ7gP4ELT++SVhE mNA7xqQvMozBRa2ZNbAc3NLbjP8I+Z+evDhRAj4eeWmELNz+1spSbuQxCGFZKcQ9CPh1 lAcfGUtb3GduAnOa/I7Oz7HcGbDoBSfu8SnXGHrGpnzVQR5R3KozeGJnxEh59SnUERlZ 1DuX4SZs6y/xzClZYnV3xum74eg8F+K5CUxyczZqrxgzOKNHgMptQeUpqvFRZvBZOqiO UqgnaJqgc425cRxwImcN7aRSWUDEQQOnVnnUGvEDJeAqWwx7yNCENsezlfkIkqp89gQi 4DFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kNv7AlLlFFJnRtks9uAPECMxkxEo1RxwuULQzYu1lYM=; b=74ULz+5cLsees6zA53+OigEIBjG91iLY6UqlzgcgRw9KyAZ/J4cJa8NFzfAIUAI+rl Se8iOQ1ycEs6gRBAvTohQmZPT7xR7p72taZjnBq5uo++KAvgKCc9/EpBICzaYD2/Wq6z wsl9KwxCJl1w2IscTwt2mSNIdfZXimbVop/zzWoxZ8yUWjotXh07pypjoRkKpN0c0saL xuSdVshoiQrCBhhfusO/Olu2MjT/+/qsHoEzK7meoBIdQO74H6rzyckeUPVwBJeYOhWf TziUm/KlYFX4BE7yk3Q6g1NNAeKq3+lOsnZl0rKp6RZwu6wRO9y3uNmeQS6TauYFxeeq 62zQ== X-Gm-Message-State: AFqh2kpGTojsitIaeyhzMT9KEKjA9s5SF7G7yRdgbJplz7u7WGlUfny+ O2JLPg3+MnokSDXgx5G4Lb+GAbpEQtI= X-Google-Smtp-Source: AMrXdXsAPz4I+OERMxxzfBaBfRfPDvpHmvh8DTlomhM81dUfrOgKou12OaTEZUXUX61UP5YcYnRdSg== X-Received: by 2002:a17:903:40cf:b0:190:f525:cde4 with SMTP id t15-20020a17090340cf00b00190f525cde4mr1905159pld.47.1671093948207; Thu, 15 Dec 2022 00:45:48 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:47 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 01/11] erofs-utils: Convert from off64_t to off_t Date: Thu, 15 Dec 2022 00:45:36 -0800 Message-Id: <20221215084546.125368-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:45:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174563 Ensure largefile macros are used to determine size of off_t and not the explict 64bit version of functions and types Signed-off-by: Khem Raj --- .../0001-configure-use-AC_SYS_LARGEFILE.patch | 43 +++++++ ...eplace-l-stat64-by-equivalent-l-stat.patch | 109 ++++++++++++++++++ ...-Make-LFS-mandatory-for-all-usecases.patch | 41 +++++++ .../erofs-utils/erofs-utils_1.5.bb | 8 +- 4 files changed, 199 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-devtools/erofs-utils/erofs-utils/0001-configure-use-AC_SYS_LARGEFILE.patch create mode 100644 meta/recipes-devtools/erofs-utils/erofs-utils/0002-erofs-replace-l-stat64-by-equivalent-l-stat.patch create mode 100644 meta/recipes-devtools/erofs-utils/erofs-utils/0003-internal.h-Make-LFS-mandatory-for-all-usecases.patch diff --git a/meta/recipes-devtools/erofs-utils/erofs-utils/0001-configure-use-AC_SYS_LARGEFILE.patch b/meta/recipes-devtools/erofs-utils/erofs-utils/0001-configure-use-AC_SYS_LARGEFILE.patch new file mode 100644 index 0000000000..75c91f51a7 --- /dev/null +++ b/meta/recipes-devtools/erofs-utils/erofs-utils/0001-configure-use-AC_SYS_LARGEFILE.patch @@ -0,0 +1,43 @@ +From fef3b16dba2c5f6ad88951b80cdfbedd423e80a0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 7 Dec 2022 20:16:52 -0800 +Subject: [PATCH v3 1/3] configure: use AC_SYS_LARGEFILE + +The autoconf macro AC_SYS_LARGEFILE defines _FILE_OFFSET_BITS=64 +where necessary to ensure that off_t and all interfaces using off_t +are 64bit, even on 32bit systems. + +Pass -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=66 via CFLAGS + +Upstream-Status: Submitted [https://lore.kernel.org/linux-erofs/20221215064758.93821-1-raj.khem@gmail.com/T/#t] +Signed-off-by: Khem Raj +--- + configure.ac | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/configure.ac b/configure.ac +index a736ff0..e8bb003 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -13,6 +13,8 @@ AC_CONFIG_MACRO_DIR([m4]) + AC_CONFIG_AUX_DIR(config) + AM_INIT_AUTOMAKE([foreign -Wall]) + ++AC_SYS_LARGEFILE ++ + # Checks for programs. + AM_PROG_AR + AC_PROG_CC +@@ -319,6 +321,9 @@ if test "x$enable_lzma" = "xyes"; then + CPPFLAGS="${saved_CPPFLAGS}" + fi + ++# Enable 64-bit off_t ++CFLAGS+=" -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ++ + # Set up needed symbols, conditionals and compiler/linker flags + AM_CONDITIONAL([ENABLE_LZ4], [test "x${have_lz4}" = "xyes"]) + AM_CONDITIONAL([ENABLE_LZ4HC], [test "x${have_lz4hc}" = "xyes"]) +-- +2.39.0 + diff --git a/meta/recipes-devtools/erofs-utils/erofs-utils/0002-erofs-replace-l-stat64-by-equivalent-l-stat.patch b/meta/recipes-devtools/erofs-utils/erofs-utils/0002-erofs-replace-l-stat64-by-equivalent-l-stat.patch new file mode 100644 index 0000000000..d12bebbf87 --- /dev/null +++ b/meta/recipes-devtools/erofs-utils/erofs-utils/0002-erofs-replace-l-stat64-by-equivalent-l-stat.patch @@ -0,0 +1,109 @@ +From 856189c324834b838f0e9cfc0d2e05f12518f264 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 7 Dec 2022 22:17:35 -0800 +Subject: [PATCH v3 2/3] erofs: replace [l]stat64 by equivalent [l]stat + +Upstream-Status: Submitted [https://lore.kernel.org/linux-erofs/20221215064758.93821-2-raj.khem@gmail.com/T/#u] +Signed-off-by: Khem Raj +--- + lib/inode.c | 10 +++++----- + lib/xattr.c | 4 ++-- + mkfs/main.c | 4 ++-- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/lib/inode.c b/lib/inode.c +index f192510..38003fc 100644 +--- a/lib/inode.c ++++ b/lib/inode.c +@@ -773,7 +773,7 @@ static u32 erofs_new_encode_dev(dev_t dev) + + #ifdef WITH_ANDROID + int erofs_droid_inode_fsconfig(struct erofs_inode *inode, +- struct stat64 *st, ++ struct stat *st, + const char *path) + { + /* filesystem_config does not preserve file type bits */ +@@ -818,7 +818,7 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode, + } + #else + static int erofs_droid_inode_fsconfig(struct erofs_inode *inode, +- struct stat64 *st, ++ struct stat *st, + const char *path) + { + return 0; +@@ -826,7 +826,7 @@ static int erofs_droid_inode_fsconfig(struct erofs_inode *inode, + #endif + + static int erofs_fill_inode(struct erofs_inode *inode, +- struct stat64 *st, ++ struct stat *st, + const char *path) + { + int err = erofs_droid_inode_fsconfig(inode, st, path); +@@ -910,7 +910,7 @@ static struct erofs_inode *erofs_new_inode(void) + /* get the inode from the (source) path */ + static struct erofs_inode *erofs_iget_from_path(const char *path, bool is_src) + { +- struct stat64 st; ++ struct stat st; + struct erofs_inode *inode; + int ret; + +@@ -918,7 +918,7 @@ static struct erofs_inode *erofs_iget_from_path(const char *path, bool is_src) + if (!is_src) + return ERR_PTR(-EINVAL); + +- ret = lstat64(path, &st); ++ ret = lstat(path, &st); + if (ret) + return ERR_PTR(-errno); + +diff --git a/lib/xattr.c b/lib/xattr.c +index 71ffe3e..fd0e728 100644 +--- a/lib/xattr.c ++++ b/lib/xattr.c +@@ -467,7 +467,7 @@ static int erofs_count_all_xattrs_from_path(const char *path) + { + int ret; + DIR *_dir; +- struct stat64 st; ++ struct stat st; + + _dir = opendir(path); + if (!_dir) { +@@ -502,7 +502,7 @@ static int erofs_count_all_xattrs_from_path(const char *path) + goto fail; + } + +- ret = lstat64(buf, &st); ++ ret = lstat(buf, &st); + if (ret) { + ret = -errno; + goto fail; +diff --git a/mkfs/main.c b/mkfs/main.c +index d2c9830..5279805 100644 +--- a/mkfs/main.c ++++ b/mkfs/main.c +@@ -581,7 +581,7 @@ int main(int argc, char **argv) + struct erofs_buffer_head *sb_bh; + struct erofs_inode *root_inode; + erofs_nid_t root_nid; +- struct stat64 st; ++ struct stat st; + erofs_blk_t nblocks; + struct timeval t; + char uuid_str[37] = "not available"; +@@ -609,7 +609,7 @@ int main(int argc, char **argv) + return 1; + } + +- err = lstat64(cfg.c_src_path, &st); ++ err = lstat(cfg.c_src_path, &st); + if (err) + return 1; + if (!S_ISDIR(st.st_mode)) { +-- +2.39.0 + diff --git a/meta/recipes-devtools/erofs-utils/erofs-utils/0003-internal.h-Make-LFS-mandatory-for-all-usecases.patch b/meta/recipes-devtools/erofs-utils/erofs-utils/0003-internal.h-Make-LFS-mandatory-for-all-usecases.patch new file mode 100644 index 0000000000..97faa5d673 --- /dev/null +++ b/meta/recipes-devtools/erofs-utils/erofs-utils/0003-internal.h-Make-LFS-mandatory-for-all-usecases.patch @@ -0,0 +1,41 @@ +From 8f8cbc7b773da63bce8226249784ba6824635c9c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 7 Dec 2022 20:19:27 -0800 +Subject: [PATCH v3 3/3] internal.h: Make LFS mandatory for all usecases + +erosfs depend on the consistent use of a 64bit offset +type, force downstreams to use transparent LFS (_FILE_OFFSET_BITS=64), +so that it becomes impossible for them to use 32bit interfaces. + +Upstream-Status: Submitted [https://lore.kernel.org/linux-erofs/20221215064758.93821-3-raj.khem@gmail.com/T/#u] +Signed-off-by: Khem Raj +--- + include/erofs/internal.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/include/erofs/internal.h b/include/erofs/internal.h +index 6a70f11..d3b2986 100644 +--- a/include/erofs/internal.h ++++ b/include/erofs/internal.h +@@ -21,6 +21,7 @@ typedef unsigned short umode_t; + + #include "erofs_fs.h" + #include ++#include /* for off_t definition */ + + #ifndef PATH_MAX + #define PATH_MAX 4096 /* # chars in a path name including nul */ +@@ -104,6 +105,10 @@ struct erofs_sb_info { + }; + }; + ++ ++/* make sure that any user of the erofs headers has atleast 64bit off_t type */ ++extern int erofs_assert_largefile[sizeof(off_t)-8]; ++ + /* global sbi */ + extern struct erofs_sb_info sbi; + +-- +2.39.0 + diff --git a/meta/recipes-devtools/erofs-utils/erofs-utils_1.5.bb b/meta/recipes-devtools/erofs-utils/erofs-utils_1.5.bb index b9a97b3e53..6ce5843570 100644 --- a/meta/recipes-devtools/erofs-utils/erofs-utils_1.5.bb +++ b/meta/recipes-devtools/erofs-utils/erofs-utils_1.5.bb @@ -6,7 +6,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=73001d804ea1e3d84365f652242cca20" HOMEPAGE = "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/tree/README" SRCREV = "a2821a66b42aee5430bccee82c280e38d1e9ab29" -SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git;branch=master" +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git;branch=master \ + file://0001-configure-use-AC_SYS_LARGEFILE.patch \ + file://0002-erofs-replace-l-stat64-by-equivalent-l-stat.patch \ + file://0003-internal.h-Make-LFS-mandatory-for-all-usecases.patch \ + " UPSTREAM_CHECK_GITTAGREGEX = "v(?P(\d+(\.\d+)+))" @@ -19,7 +23,7 @@ inherit pkgconfig autotools PACKAGECONFIG ??= "lz4" PACKAGECONFIG[lz4] = "--enable-lz4,--disable-lz4,lz4" -EXTRA_OECONF = "${PACKAGECONFIG_CONFARGS} --disable-fuse" +EXTRA_OECONF = "${PACKAGECONFIG_CONFARGS} --disable-fuse --enable-largefile" CFLAGS:append:powerpc64le = " -D__SANE_USERSPACE_TYPES__" From patchwork Thu Dec 15 08:45:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98E9AC4332F for ; Thu, 15 Dec 2022 08:45:50 +0000 (UTC) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mx.groups.io with SMTP id smtpd.web11.129132.1671093950150936066 for ; Thu, 15 Dec 2022 00:45:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Yub38l1l; spf=pass (domain: gmail.com, ip: 209.85.214.170, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f170.google.com with SMTP id t2so6148572ply.2 for ; Thu, 15 Dec 2022 00:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vcb0IljHuNGtoTs5WEVGN7N0/VKiTHDOwnW/iH98r3s=; b=Yub38l1lP6Z9auJhhxyU1n/AA8yo8K8XMfaESIrsIB2sCG9GfAbXwVVKc5PaCsUiip NSNt8vlhWqW2dE9OOE9ZOooB+VS7lBgupvY8h0SmDXVmNDWx5RUTWjbFqVNqhIunlpPx 5CTdlMR04RDcKOaut7MfInqbjVVyfIErXIwc+1jTWPZw4RHGmorM8znzfRFZkvtHvDTb BGPcdWv8PQQgoaYeGg9IyMIJSFgk9iDn8kbFayHHJcfRffqiQztAWLgqEpxZFFRLVYcy 5XaHirkkI1JHku69DEOiazaa6FW0dAHVWIIwY6O0SMQmq+C3VUDXWnzpInz/vM9+6SCD ANgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vcb0IljHuNGtoTs5WEVGN7N0/VKiTHDOwnW/iH98r3s=; b=53OeVsvfbmpgJZvu798BwJ4Lt88SSjovXGifv3Xp+kkRrc5JIO6frN6RnIFVCi9Q6J W35cCX1s0tgFusKWDXI8B5UWO6OvtAulTaDxixJ48IDRCnwuDoXJdrsUMa0G+GZqdH6d ISpICJ4vyWFdtgB1rEDrnGIH8GN5OTA7QAB5dGoRrHN7O49U7smFp4GKDJ5TgkaKFjRr yQSYCqjK08+qqvR6WSt6tp5tkpj9zCW3X4Kh2VM6RJR6BN1jNU4QHor0ERO3T2juzXMI fWk3kFMeUpXprk4XnWgcx3qxYXtZ7s7ewU2NxyksnF4Pjn6/tEytnslyDnZRJpq3upNN oG9Q== X-Gm-Message-State: ANoB5pmQPX3/9HiKYC+Lx9iG/zuaeabyF/WA8yYz0Ji2c3/oDzgYkkxe 6dBGjbH/+CY9Nm8jRXC9IIMARrQRfd8= X-Google-Smtp-Source: AA0mqf4/aNiDqgZQrm/qWIPPFPgK4CJpsmLQDSL28lr+q276QhbETmiGAzTzUuvYb7HI1mfocvACjw== X-Received: by 2002:a17:902:8343:b0:186:95c9:ddc9 with SMTP id z3-20020a170902834300b0018695c9ddc9mr32891240pln.55.1671093949173; Thu, 15 Dec 2022 00:45:49 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:48 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 02/11] pseudo: Remove 64bit time_t flags Date: Thu, 15 Dec 2022 00:45:37 -0800 Message-Id: <20221215084546.125368-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:45:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174564 pseudo traps syscalls and has intimate knowledge of them and does not really depend on glibc interfaces to kernel flags are added via TARGET_CC_ARCH therefore move the remove operation from TARGET_CPPFLAGS to TARGET_CC_ARCH Signed-off-by: Khem Raj --- meta/recipes-devtools/pseudo/pseudo_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb index 8bb8993439..1a708066f7 100644 --- a/meta/recipes-devtools/pseudo/pseudo_git.bb +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb @@ -22,7 +22,7 @@ PV = "1.9.0+git${SRCPV}" # aliased due to this e.g. open/open64 and it will complain about duplicate definitions # pseudo on 32bit systems is not much of use anyway and these features are not of much # use for it. -TARGET_CPPFLAGS:remove = "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +TARGET_CC_ARCH:remove = "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64" # error: use of undeclared identifier '_STAT_VER' COMPATIBLE_HOST:libc-musl = 'null' From patchwork Thu Dec 15 08:45:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CA85C4332F for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.web11.129133.1671093950845663649 for ; Thu, 15 Dec 2022 00:45:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aqvx63HO; spf=pass (domain: gmail.com, ip: 209.85.216.50, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f50.google.com with SMTP id fa4-20020a17090af0c400b002198d1328a0so5906325pjb.0 for ; Thu, 15 Dec 2022 00:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iXLBNZIaWN69yWBDM0FHjLYM3eiB+/2hmhh0k/ptxak=; b=aqvx63HOChvALozbDMHOtxSV0CxyDETTsulXZhQL1RmEgP5Q3HYNUjvoqyk09o7cy4 Y7kML5DdQfcG/W0c1Y4AJlUxrTnK/A9+3O81IlPk2ey1vbxoCLSkd4J4ZKztd8knjVYr 0wE3ekURFQYJ+bnYMHsLkUuGM8RsNqoE5tj3nuSzKDzHTLq1Uci81hcj3LXO/cXl3IKS FTGOh7yfVa08smlAXUnsHhGtVs+xDy+TTOSB4ZDKn2DB5pdt5UFH1DzxN0nzzV8Zhkdp pmdDoT9ZnTzyz7V/QBM0cCTESwhoujwo4k8QIHQ2CbkXsRlIw+Tz/tDk2dKWT1OnxhTE is/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iXLBNZIaWN69yWBDM0FHjLYM3eiB+/2hmhh0k/ptxak=; b=KAZLaXtHrG/m3S4N8mxHfKHZUgPEVKIKOteodkTOqckHRXbE/57vEfSgOakYtRfAMo WjFBmOAdCfOTt/sGH+LPBWADEGDZj0HVylUIHJoKrC1vwahWQa7bYAo9GAOsCfblTFdp 1gXZpVFJsapA+nqhCmvUHUKMuESIY2hKSy0POPUeX+Ioi6wDrRiUS5d9v7dViekut8I9 84+pSzI1Mc8pu91+P1wx/kNncw9fN4AXnCjSFr07cbAx8xB/3SxIw76MZ+wi0GNA8eif 1I6xBfQ+Oygbx2zvxPv4BEQ+m0ag89nmd6KPYRCM3S+orRmQMfnSBGmUDvnK7Nis9NjO CARA== X-Gm-Message-State: ANoB5pn6CEgI9IGrMliuH5nnoHfuhfZjtZmq2nFpNR1FhnERnHFQzjWn d+cXRYsSgjnuUKwbkaqEq5H1RpwBeSA= X-Google-Smtp-Source: AA0mqf6I+k33hYCHArbjNYvJMgG+xhDouGDWYaqbpI/N4A/oKOpjGeXM7w9dfwHuRHHybBN7C+OA/A== X-Received: by 2002:a17:903:330c:b0:189:d066:81c5 with SMTP id jk12-20020a170903330c00b00189d06681c5mr32982697plb.36.1671093950044; Thu, 15 Dec 2022 00:45:50 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:49 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 03/11] unfs3: Define off64_t in terms of off_t on musl Date: Thu, 15 Dec 2022 00:45:38 -0800 Message-Id: <20221215084546.125368-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174565 Signed-off-by: Khem Raj --- ...4_t-to-off_t-on-linux-if-not-defined.patch | 28 +++++++++++++++++++ meta/recipes-devtools/unfs3/unfs3_git.bb | 3 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/unfs3/unfs3/0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch diff --git a/meta/recipes-devtools/unfs3/unfs3/0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch b/meta/recipes-devtools/unfs3/unfs3/0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch new file mode 100644 index 0000000000..91909fa236 --- /dev/null +++ b/meta/recipes-devtools/unfs3/unfs3/0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch @@ -0,0 +1,28 @@ +From 949db882e487d728c44bb68139682b38396dd275 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Dec 2022 14:50:10 -0800 +Subject: [PATCH] Alias off64_t to off_t on linux if not defined + +Musl C library does not define off64_t and has 64-bit default off_t +therefore define off64_t as an alias on linux as well when configure +detects that off64_t is not provided by a linux system + +Upstream-Status: Submitted [https://github.com/unfs3/unfs3/pull/29] +Signed-off-by: Khem Raj +--- + nfs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/nfs.h b/nfs.h +index aded011..7996c67 100644 +--- a/nfs.h ++++ b/nfs.h +@@ -62,7 +62,7 @@ typedef int32_t int32; + #endif + + #ifndef HAVE_OFF64_T +-#ifdef __APPLE__ ++#if defined(__APPLE__) || defined(__linux__) + typedef off_t off64_t; + #endif + #endif diff --git a/meta/recipes-devtools/unfs3/unfs3_git.bb b/meta/recipes-devtools/unfs3/unfs3_git.bb index 606c103a79..a4701bdb57 100644 --- a/meta/recipes-devtools/unfs3/unfs3_git.bb +++ b/meta/recipes-devtools/unfs3/unfs3_git.bb @@ -14,7 +14,8 @@ DEPENDS:append:class-nativesdk = " flex-nativesdk" S = "${WORKDIR}/git" SRC_URI = "git://github.com/unfs3/unfs3.git;protocol=https;branch=master \ file://0001-daemon.c-Fix-race-window-for-writing-of-the-pid-file.patch \ - " + file://0001-Alias-off64_t-to-off_t-on-linux-if-not-defined.patch \ + " SRCREV = "c8f2d2cd4529955419bad0e163f88d47ff176b8d" UPSTREAM_CHECK_GITTAGREGEX = "unfs3\-(?P\d+(\.\d+)+)" From patchwork Thu Dec 15 08:45:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A04FEC3DA6D for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.web10.128335.1671093951750537163 for ; Thu, 15 Dec 2022 00:45:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LW0KhTLN; spf=pass (domain: gmail.com, ip: 209.85.216.50, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f50.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so2042137pjj.2 for ; Thu, 15 Dec 2022 00:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tPxHdua0NCXLGPjPRFpVEkpTULMf+Jqj8dDqQJlJ484=; b=LW0KhTLNR2Gm1qrhNgnjSz75CuH5I3+WWc+j5t81+TjLWLeNqpwFIhqpe8GeikfSyb GdtpJ38yz9MQrW3H6WLoREMvMyTb7ig9jIgl+cdz8diUNY+g4RPZxLNouQpS6Bowcit7 R9hhqc9a06O76OvizvtBS0o2Ja4ncoyQQEsvuIZoenM79+8muLzLD2A+Sm/gPhiv1KQT tujYGG0543aYpoqeW1CmqIQkJXZdxOs2yaTCTaK3h1aeAJe+uqeuG2C9tb2Tgz7zwpz3 XeDIFxnRQllS6EXTSTCc5wrwDvzgk0jlzkQKatZ0Izb2zsxGvA506WY7vQEVXXmSBy6E I2lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tPxHdua0NCXLGPjPRFpVEkpTULMf+Jqj8dDqQJlJ484=; b=4h/vHjk8z+mTNlx/QKKEuVSClHjwFFtn3W5FGLVzsrRCzmG3n2JWmjAXIs/78S2HfM I9FH5xJ9ytcCnr7RBCtrieNezs+PFzVtsQm/GKfb+GzegM6SOmbg7kFs4e9VRo4hdWoZ xOjSH42DhDq3/ZIPCU4a6mLxu8y3rUgAOGA0KLETFu9JLa3+VWgGYdD1Bk/HeG3xM17W 2FniKOB20OpqWEy6SP6ZVwp4NjkgN7VlTn/NDMjX+GyT767mkuLjrr78lMOY06yfNxns xKFj4ZKOuud5n0FODh3Vw8Pape8DlmieN+747zLphrQL4EWc5vI4cT2BqjwQgvKyLvod 9t+g== X-Gm-Message-State: ANoB5pnIr+/OvXsd2wEUDRfBYuDS/jzZGFXcMH8gEe8Ot5sZfT1zchzS leS/hs8Sz0NS9FTauVX4DoS2ePSVn4Y= X-Google-Smtp-Source: AA0mqf5MaNZ/ctixYGi0wBhG0gRuML3qMpykz5poxRmFNNOCIX2mpjc4HAvgTGBWD/q0F4QLYCGO2w== X-Received: by 2002:a17:902:684c:b0:189:5f5c:da1d with SMTP id f12-20020a170902684c00b001895f5cda1dmr29126957pln.18.1671093950945; Thu, 15 Dec 2022 00:45:50 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:50 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 04/11] acpid: Fix largefile enabled build Date: Thu, 15 Dec 2022 00:45:39 -0800 Message-Id: <20221215084546.125368-4-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174566 Signed-off-by: Khem Raj --- meta/recipes-bsp/acpid/acpid.inc | 3 +- .../acpid/0001-Replace-stat64-with-stat.patch | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-bsp/acpid/acpid/0001-Replace-stat64-with-stat.patch diff --git a/meta/recipes-bsp/acpid/acpid.inc b/meta/recipes-bsp/acpid/acpid.inc index 98910bab29..7b2f1c71c5 100644 --- a/meta/recipes-bsp/acpid/acpid.inc +++ b/meta/recipes-bsp/acpid/acpid.inc @@ -13,7 +13,8 @@ LICENSE = "GPL-2.0-or-later" SRC_URI = "${SOURCEFORGE_MIRROR}/acpid2/acpid-${PV}.tar.xz \ file://init \ file://acpid.service \ - " + file://0001-Replace-stat64-with-stat.patch \ + " CVE_PRODUCT = "acpid2" diff --git a/meta/recipes-bsp/acpid/acpid/0001-Replace-stat64-with-stat.patch b/meta/recipes-bsp/acpid/acpid/0001-Replace-stat64-with-stat.patch new file mode 100644 index 0000000000..10abfc8388 --- /dev/null +++ b/meta/recipes-bsp/acpid/acpid/0001-Replace-stat64-with-stat.patch @@ -0,0 +1,31 @@ +From 4b729235a9e96f120feee7e3746818aad0f3b924 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Dec 2022 15:04:30 -0800 +Subject: [PATCH] Replace stat64 with stat + +It already checks for largefile support in configure.ac via +AC_SYS_LARGEFILE macro, which will ensure that 64bit elements +are correctly setup for stat APIs on platforms needing large +file support. + +Upstream-Status: Submitted [https://sourceforge.net/p/acpid2/code/merge-requests/5/] +Signed-off-by: Khem Raj +--- + sock.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sock.c b/sock.c +index 9e04501..3121fb7 100644 +--- a/sock.c ++++ b/sock.c +@@ -54,8 +54,8 @@ int non_root_clients; + static int + isfdtype(int fd, int fdtype) + { +- struct stat64 st; +- if (fstat64(fd, &st) != 0) ++ struct stat st; ++ if (fstat(fd, &st) != 0) + return -1; + return ((st.st_mode & S_IFMT) == (mode_t)fdtype); + } From patchwork Thu Dec 15 08:45:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16764 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93B87C2D0CB for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mx.groups.io with SMTP id smtpd.web10.128336.1671093952569947442 for ; Thu, 15 Dec 2022 00:45:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IbkJJ235; spf=pass (domain: gmail.com, ip: 209.85.214.175, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f175.google.com with SMTP id m4so6142129pls.4 for ; Thu, 15 Dec 2022 00:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tYYKReEuavMWQkmcy31MuRKUZ67knRl3zDzPoUfRGC4=; b=IbkJJ235dSgjwUT3eo/Er1vcDM0HZQ3CE2ubb/BmC3MBjQ4NlzMWHMbc50vqCvr2yw odlL9LsdgUars1nFShRiu7fTL/BoyGby3btQc+Fn8sWi80L7VjpkZgqmddZe8ItU6lC+ 8LrrubRijwunAtJd8nON1DD+wC5QKiC2WqZ2kzglMIXXP0n9Jw9zBKkHdBMLS2ViF+4H lnoepJf1ex+Os3xiYhUckgUFlEHWYlKtpZepTIzth05IEOskRH4MyNXaUBVS//SMuimu Z9ujM3T7+NHNWjgC003KXwqljrzi6Ynqmi5ghb1bJWLJchNYtijdlBx2Abzt2Z4KgYqU NOmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tYYKReEuavMWQkmcy31MuRKUZ67knRl3zDzPoUfRGC4=; b=6varTCkh8oZYob4EOxuna9iM174zc+hM05v8prOq31Roenmy9oziLs7PVQ98C2gwjQ dC6KJQx6y685VGfL5dZ5BH7PE8rfN8nzQNGaz0bKpwfg7q3ogwxswgRCV2XAdfw57vSV dEL2gUjY1KGAeONaOohRpqSmdzezxHjv3X/hRDm4irHoi7/lteOHfYEVZKzyaD9BKkqD qI9hyjxpd/waYAJD2tUGWBlOiphi+R0w0K8GlcO8PsU+D/rclj08GpMyMzVIGR+Y3t7P C99+nnJdpsXwG89VcQgKiP+D9UbTwpbWL1YIbFHaJVflXkbuE+LqSEry7h2yKlPiWlg6 mKfw== X-Gm-Message-State: ANoB5pmBGvnFVUGNQf6FDg1W0CV+SSiFCi2929ierJefEQW3OlOjOy6P r8iRkuIGaBJx6vDWvAPQM5rEIIVVThE= X-Google-Smtp-Source: AA0mqf5QXlnRm5pztk10NL4mT+TbpgZxfbXLNc2KyJTyaRPve1MhHsW+IDzVLMaI9xsNHT/1dzqO8Q== X-Received: by 2002:a17:902:ccd0:b0:186:f57d:8573 with SMTP id z16-20020a170902ccd000b00186f57d8573mr31330024ple.2.1671093951732; Thu, 15 Dec 2022 00:45:51 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:51 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 05/11] efivar: Replace off64_t with off_t Date: Thu, 15 Dec 2022 00:45:40 -0800 Message-Id: <20221215084546.125368-5-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174567 Signed-off-by: Khem Raj --- .../0001-Use-off_t-instead-of-off64_t.patch | 39 +++++++++++++++++++ meta/recipes-bsp/efivar/efivar_38.bb | 1 + 2 files changed, 40 insertions(+) create mode 100644 meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch diff --git a/meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch b/meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch new file mode 100644 index 0000000000..f47a457386 --- /dev/null +++ b/meta/recipes-bsp/efivar/efivar/0001-Use-off_t-instead-of-off64_t.patch @@ -0,0 +1,39 @@ +From 1eb0fa531301a5045af1b020fc093c4fcfd38680 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Dec 2022 16:55:51 -0800 +Subject: [PATCH] Use off_t instead of off64_t + +Pass _FILE_OFFSET_BITS=64 to ensure 64bit off_t + +Upstream-Status: Submitted [https://github.com/rhboot/efivar/pull/237] +Signed-off-by: Khem Raj +--- + src/error.c | 2 +- + src/include/defaults.mk | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/error.c b/src/error.c +index fcbba0d..9530e22 100644 +--- a/src/error.c ++++ b/src/error.c +@@ -191,7 +191,7 @@ dbglog_write(void *cookie, const char *buf, size_t size) + } + + static int +-dbglog_seek(void *cookie UNUSED, off64_t *offset, int whence) ++dbglog_seek(void *cookie UNUSED, off_t *offset, int whence) + { + FILE *log = efi_errlog ? efi_errlog : stderr; + int rc; +diff --git a/src/include/defaults.mk b/src/include/defaults.mk +index 632b155..95be8be 100644 +--- a/src/include/defaults.mk ++++ b/src/include/defaults.mk +@@ -34,6 +34,7 @@ CPPFLAGS ?= + override _CPPFLAGS := $(CPPFLAGS) + override CPPFLAGS = $(_CPPFLAGS) -DLIBEFIVAR_VERSION=$(VERSION) \ + -D_GNU_SOURCE \ ++ -D_FILE_OFFSET_BITS=64 \ + -I$(TOPDIR)/src/include/ + CFLAGS ?= $(OPTIMIZE) $(DEBUGINFO) $(WARNINGS) $(ERRORS) + CFLAGS_GCC ?= -specs=$(TOPDIR)/src/include/gcc.specs \ diff --git a/meta/recipes-bsp/efivar/efivar_38.bb b/meta/recipes-bsp/efivar/efivar_38.bb index 6a6918931b..5523329699 100644 --- a/meta/recipes-bsp/efivar/efivar_38.bb +++ b/meta/recipes-bsp/efivar/efivar_38.bb @@ -13,6 +13,7 @@ SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \ file://efisecdb-fix-build-with-musl-libc.patch \ file://0001-Fix-invalid-free-in-main.patch \ file://0001-Fix-glibc-2.36-build-mount.h-conflicts.patch \ + file://0001-Use-off_t-instead-of-off64_t.patch \ " SRCREV = "1753149d4176ebfb2b135ac0aaf79340bf0e7a93" From patchwork Thu Dec 15 08:45:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94BE9C2D0CD for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web10.128338.1671093953646276517 for ; Thu, 15 Dec 2022 00:45:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=i4gspSqF; spf=pass (domain: gmail.com, ip: 209.85.216.46, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f46.google.com with SMTP id t11-20020a17090a024b00b0021932afece4so2011646pje.5 for ; Thu, 15 Dec 2022 00:45:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pZJsFbyqjITiaRDWdhkjg839s2hI8UxEvbmpYZQsT64=; b=i4gspSqFjvjuIGqe0JjYtlphFQnrn4zg1xCoXk+JiwP/w0AnMhb2Jys+IwUqLxIWBq hvt39Kczia0TgKCIrto4mT06tcXVkYrDuhUReP73FZrGYtk5oKXcydo/Ji0522uPTzNt Zya1KYgNqvej8KaEOsbUvT3y/hZLWr56VEIf4pmY5FTCZPSDqXkUhrb3iK/1ef3hwPMj tbsHrJAbf911HN2hzQnQaUpd18n7z12cg+ow7tl400YbAx7Pcn0uN8QsobCFDft4pcon h8C9oU5blvo9VvuYoecjbtA1ZINxYDnbBmhwrCT8ERdFuXnDIwK8B2/XSqDTzdVRyBmO lXKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pZJsFbyqjITiaRDWdhkjg839s2hI8UxEvbmpYZQsT64=; b=afkJ6mlCo/sT2aqunkcDm+WwcuxLkYkXLtSJTz7rZe6WenFWpffzK2tCD4XLB5h/Db z2MgY8Ck3iEdsWd84dbdLYVPglqPNV+9h8nPiYyUpoEEMZ31/IzVB5cZx2p6FhtOE8oH WEbsOwcZDKsnXKkrENDQha97JVyOwyIyxMDsnwKfS3xzt0oNl7tqdFGwmwQw3AVCiPa/ EA6KOk9LL4PGJIUb99yqexD9vCmQbYFYeyoGhSQdld8lkVvZz9sj7+ShB8K4dI3s29PL r6VWf9lvHOq6gdHjuxDyZn5nZZG9kH/kHs0FB7OVRNnGJA/MZGeTcxW+MLSoxSbb0FF6 EJjQ== X-Gm-Message-State: ANoB5pkF9uxONqlnCNt9CUoOprMQ51d4GFsxoGzMNI0DXCUFJCxmjRfg TkaL3GSuUCXRT7ZV1QwfylYK6nBJU34= X-Google-Smtp-Source: AA0mqf7UZKV6yrhg2dELdOju172R4Lh8sXbmBPs9dG+3G7BiR6u7tkWiDpyAqtiVa+c6Jco0NAElMQ== X-Received: by 2002:a17:902:8605:b0:186:5fa1:1eae with SMTP id f5-20020a170902860500b001865fa11eaemr23993564plo.48.1671093952591; Thu, 15 Dec 2022 00:45:52 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:52 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 06/11] ltp: Fix largefile support Date: Thu, 15 Dec 2022 00:45:41 -0800 Message-Id: <20221215084546.125368-6-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174568 Signed-off-by: Khem Raj --- ...0001-testcases-Fix-largefile-support.patch | 426 ++++++++++++++++++ meta/recipes-extended/ltp/ltp_20220930.bb | 1 + 2 files changed, 427 insertions(+) create mode 100644 meta/recipes-extended/ltp/ltp/0001-testcases-Fix-largefile-support.patch diff --git a/meta/recipes-extended/ltp/ltp/0001-testcases-Fix-largefile-support.patch b/meta/recipes-extended/ltp/ltp/0001-testcases-Fix-largefile-support.patch new file mode 100644 index 0000000000..e9b48c392f --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-testcases-Fix-largefile-support.patch @@ -0,0 +1,426 @@ +From 3cca69b85c88c6eb4f02313b3c6a9e0f6cc0b5d7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Dec 2022 18:14:22 -0800 +Subject: [PATCH] testcases: Fix largefile support + +Use standard functions ( not 64-bit equivalents ) which operate on off_t +and pass -D_FILE_OFFSET_BITS=64 to enable LFS always so off_t is 64bit +for these tests. + +This helps making it portable across musl which has removed the 64bit +transition functions from _GNU_SOURCE namespace. + +Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2022-December/032310.html] +Signed-off-by: Khem Raj +--- + testcases/kernel/io/direct_io/Makefile | 2 +- + testcases/kernel/io/direct_io/diotest2.c | 4 ++-- + testcases/kernel/io/direct_io/diotest5.c | 10 +++++----- + testcases/kernel/io/direct_io/diotest6.c | 4 ++-- + testcases/kernel/syscalls/fcntl/fcntl18.c | 6 +++--- + testcases/kernel/syscalls/fcntl/fcntl34.c | 2 +- + testcases/kernel/syscalls/fcntl/fcntl36.c | 4 ++-- + testcases/kernel/syscalls/llseek/Makefile | 2 ++ + testcases/kernel/syscalls/llseek/llseek01.c | 14 +++++++------- + testcases/kernel/syscalls/llseek/llseek02.c | 12 ++++++------ + testcases/kernel/syscalls/llseek/llseek03.c | 6 +++--- + testcases/kernel/syscalls/open/Makefile | 2 ++ + testcases/kernel/syscalls/open/open12.c | 6 +++--- + testcases/kernel/syscalls/openat/Makefile | 2 ++ + testcases/kernel/syscalls/openat/openat02.c | 6 +++--- + testcases/kernel/syscalls/sync_file_range/Makefile | 2 ++ + .../syscalls/sync_file_range/sync_file_range01.c | 4 ++-- + .../syscalls/sync_file_range/sync_file_range02.c | 6 +++--- + 18 files changed, 51 insertions(+), 43 deletions(-) + +diff --git a/testcases/kernel/io/direct_io/Makefile b/testcases/kernel/io/direct_io/Makefile +index 777f7b166..7480d7b0d 100644 +--- a/testcases/kernel/io/direct_io/Makefile ++++ b/testcases/kernel/io/direct_io/Makefile +@@ -5,7 +5,7 @@ top_srcdir ?= ../../../.. + + include $(top_srcdir)/include/mk/testcases.mk + +-CFLAGS += -DSHARED_OFILE -D_GNU_SOURCE ++CFLAGS += -DSHARED_OFILE -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE + + LDLIBS += -lpthread + +diff --git a/testcases/kernel/io/direct_io/diotest2.c b/testcases/kernel/io/direct_io/diotest2.c +index c407c46ae..db47ee8ef 100644 +--- a/testcases/kernel/io/direct_io/diotest2.c ++++ b/testcases/kernel/io/direct_io/diotest2.c +@@ -78,7 +78,7 @@ int bufsize = BUFSIZE; + * For each iteration, write data starting at offse+iter*bufsize + * location in the file and read from there. + */ +-int runtest(int fd_r, int fd_w, int iter, off64_t offset, int action) ++int runtest(int fd_r, int fd_w, int iter, off_t offset, int action) + { + char *buf1; + char *buf2; +@@ -136,7 +136,7 @@ static void cleanup(void); + int main(int argc, char *argv[]) + { + int iter = 100; /* Iterations. Default 100 */ +- off64_t offset = 0; /* Offset. Default 0 */ ++ off_t offset = 0; /* Offset. Default 0 */ + int i, action, fd_r, fd_w; + int fail_count = 0, total = 0, failed = 0; + +diff --git a/testcases/kernel/io/direct_io/diotest5.c b/testcases/kernel/io/direct_io/diotest5.c +index 9bf917c64..ac66f2a04 100644 +--- a/testcases/kernel/io/direct_io/diotest5.c ++++ b/testcases/kernel/io/direct_io/diotest5.c +@@ -75,14 +75,14 @@ int TST_TOTAL = 3; /* Total number of test conditions */ + static int bufsize = BUFSIZE; /* Buffer size. Default 4k */ + static int iter = 20; /* Iterations. Default 20 */ + static int nvector = 20; /* Vector array. Default 20 */ +-static off64_t offset = 0; /* Start offset. Default 0 */ ++static off_t offset = 0; /* Start offset. Default 0 */ + static char filename[LEN]; /* Test data file */ + static int fd1 = -1; + /* + * runtest: Write the data in vector array to the file. Read the data + * from the file into another vectory array and verify. Repeat the test. + */ +-int runtest(int fd_r, int fd_w, int iter, off64_t offset, int action) ++int runtest(int fd_r, int fd_w, int iter, off_t offset, int action) + { + int i; + struct iovec *iov1, *iov2, *iovp; +@@ -218,7 +218,7 @@ int main(int argc, char *argv[]) + tst_brkm(TBROK, cleanup, "fd_w open failed for %s: %s", + filename, strerror(errno)); + } +- if ((fd_r = open64(filename, O_DIRECT | O_RDONLY | O_CREAT, 0666)) < 0) { ++ if ((fd_r = open(filename, O_DIRECT | O_RDONLY | O_CREAT, 0666)) < 0) { + tst_brkm(TBROK, cleanup, "fd_r open failed for %s: %s", + filename, strerror(errno)); + } +@@ -240,7 +240,7 @@ int main(int argc, char *argv[]) + tst_brkm(TBROK, cleanup, "fd_w open failed for %s: %s", + filename, strerror(errno)); + } +- if ((fd_r = open64(filename, O_RDONLY | O_CREAT, 0666)) < 0) { ++ if ((fd_r = open(filename, O_RDONLY | O_CREAT, 0666)) < 0) { + tst_brkm(TBROK, cleanup, "fd_r open failed for %s: %s", + filename, strerror(errno)); + } +@@ -261,7 +261,7 @@ int main(int argc, char *argv[]) + tst_brkm(TBROK, cleanup, "fd_w open failed for %s: %s", + filename, strerror(errno)); + } +- if ((fd_r = open64(filename, O_DIRECT | O_RDONLY | O_CREAT, 0666)) < 0) { ++ if ((fd_r = open(filename, O_DIRECT | O_RDONLY | O_CREAT, 0666)) < 0) { + tst_brkm(TBROK, cleanup, "fd_r open failed for %s: %s", + filename, strerror(errno)); + } +diff --git a/testcases/kernel/io/direct_io/diotest6.c b/testcases/kernel/io/direct_io/diotest6.c +index a06e6b82b..1905380f0 100644 +--- a/testcases/kernel/io/direct_io/diotest6.c ++++ b/testcases/kernel/io/direct_io/diotest6.c +@@ -62,7 +62,7 @@ int TST_TOTAL = 3; + + static int iter = 100; + static int bufsize = BUFSIZE; +-static off64_t offset = 0; ++static off_t offset = 0; + static int nvector = 20; + static char filename[LEN]; + static int fd1 = -1; +@@ -84,7 +84,7 @@ static void prg_usage(void) + */ + int runtest(int fd_r, int fd_w, int childnum, int action) + { +- off64_t seekoff; ++ off_t seekoff; + int i, ret = -1; + ssize_t n = 0; + struct iovec *iov_r, *iov_w; +diff --git a/testcases/kernel/syscalls/fcntl/fcntl18.c b/testcases/kernel/syscalls/fcntl/fcntl18.c +index 5eefbd128..1105dd393 100644 +--- a/testcases/kernel/syscalls/fcntl/fcntl18.c ++++ b/testcases/kernel/syscalls/fcntl/fcntl18.c +@@ -103,11 +103,11 @@ int main(int ac, char **av) + tst_resm(TINFO, "Enter block 2"); + fail = 0; + /* Error condition if address is bad */ +- retval = fcntl(fd, F_GETLK64, (struct flock *)INVAL_FLAG); ++ retval = fcntl(fd, F_GETLK, (struct flock *)INVAL_FLAG); + if (errno == EFAULT) { +- tst_resm(TPASS, "Test F_GETLK64: for errno EFAULT PASSED"); ++ tst_resm(TPASS, "Test F_GETLK: for errno EFAULT PASSED"); + } else { +- tst_resm(TFAIL, "Test F_GETLK64: for errno EFAULT FAILED"); ++ tst_resm(TFAIL, "Test F_GETLK: for errno EFAULT FAILED"); + fail = 1; + } + if (fail) { +diff --git a/testcases/kernel/syscalls/fcntl/fcntl34.c b/testcases/kernel/syscalls/fcntl/fcntl34.c +index 3442114ff..536dead29 100644 +--- a/testcases/kernel/syscalls/fcntl/fcntl34.c ++++ b/testcases/kernel/syscalls/fcntl/fcntl34.c +@@ -54,7 +54,7 @@ void *thread_fn_01(void *arg) + + memset(buf, (intptr_t)arg, write_size); + +- struct flock64 lck = { ++ struct flock lck = { + .l_whence = SEEK_SET, + .l_start = 0, + .l_len = 1, +diff --git a/testcases/kernel/syscalls/fcntl/fcntl36.c b/testcases/kernel/syscalls/fcntl/fcntl36.c +index d6b07fc41..4e4d48afc 100644 +--- a/testcases/kernel/syscalls/fcntl/fcntl36.c ++++ b/testcases/kernel/syscalls/fcntl/fcntl36.c +@@ -72,7 +72,7 @@ static void *fn_ofd_w(void *arg) + int fd = SAFE_OPEN(fname, O_RDWR); + long wt = pa->cnt; + +- struct flock64 lck = { ++ struct flock lck = { + .l_whence = SEEK_SET, + .l_start = pa->offset, + .l_len = pa->length, +@@ -151,7 +151,7 @@ static void *fn_ofd_r(void *arg) + int i; + int fd = SAFE_OPEN(fname, O_RDWR); + +- struct flock64 lck = { ++ struct flock lck = { + .l_whence = SEEK_SET, + .l_start = pa->offset, + .l_len = pa->length, +diff --git a/testcases/kernel/syscalls/llseek/Makefile b/testcases/kernel/syscalls/llseek/Makefile +index 044619fb8..8a916d0fa 100644 +--- a/testcases/kernel/syscalls/llseek/Makefile ++++ b/testcases/kernel/syscalls/llseek/Makefile +@@ -6,3 +6,5 @@ top_srcdir ?= ../../../.. + include $(top_srcdir)/include/mk/testcases.mk + + include $(top_srcdir)/include/mk/generic_leaf_target.mk ++ ++CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE +diff --git a/testcases/kernel/syscalls/llseek/llseek01.c b/testcases/kernel/syscalls/llseek/llseek01.c +index 50f35493d..efb444dc8 100644 +--- a/testcases/kernel/syscalls/llseek/llseek01.c ++++ b/testcases/kernel/syscalls/llseek/llseek01.c +@@ -4,7 +4,7 @@ + * 07/2001 Ported by Wayne Boyer + */ + /* +- * Verify that lseek64() call succeeds to set the file pointer position to an ++ * Verify that lseek() call succeeds to set the file pointer position to an + * offset larger than file size limit (RLIMIT_FSIZE). Also, verify that any + * attempt to write to this location fails. + */ +@@ -27,22 +27,22 @@ static int fildes; + + static void verify_llseek(void) + { +- TEST(lseek64(fildes, (loff_t) (80 * BUFSIZ), SEEK_SET)); ++ TEST(lseek(fildes, (loff_t) (80 * BUFSIZ), SEEK_SET)); + if (TST_RET == (80 * BUFSIZ)) +- tst_res(TPASS, "lseek64() can set file pointer position larger than file size limit"); ++ tst_res(TPASS, "lseek() can set file pointer position larger than file size limit"); + else +- tst_res(TFAIL, "lseek64() returned wrong value %ld when write past file size", TST_RET); ++ tst_res(TFAIL, "lseek() returned wrong value %ld when write past file size", TST_RET); + + if (write(fildes, write_buff, BUFSIZ) == -1) + tst_res(TPASS,"write failed after file size limit"); + else + tst_brk(TFAIL, "write successful after file size limit"); + +- TEST(lseek64(fildes, (loff_t) BUFSIZ, SEEK_SET)); ++ TEST(lseek(fildes, (loff_t) BUFSIZ, SEEK_SET)); + if (TST_RET == BUFSIZ) +- tst_res(TPASS,"lseek64() can set file pointer position under filer size limit"); ++ tst_res(TPASS,"lseek() can set file pointer position under filer size limit"); + else +- tst_brk(TFAIL,"lseek64() returns wrong value %ld when write under file size", TST_RET); ++ tst_brk(TFAIL,"lseek() returns wrong value %ld when write under file size", TST_RET); + + if (write(fildes, write_buff, BUFSIZ) != -1) + tst_res(TPASS, "write succcessfully under file size limit"); +diff --git a/testcases/kernel/syscalls/llseek/llseek02.c b/testcases/kernel/syscalls/llseek/llseek02.c +index 3d9c21fc9..5431969f9 100644 +--- a/testcases/kernel/syscalls/llseek/llseek02.c ++++ b/testcases/kernel/syscalls/llseek/llseek02.c +@@ -5,8 +5,8 @@ + */ + /* + * Description: +- * 1) lseek64(2) fails and sets errno to EINVAL when whence is invalid. +- * 2) lseek64(2) fails ans sets errno to EBADF when fd is not an open ++ * 1) lseek(2) fails and sets errno to EINVAL when whence is invalid. ++ * 2) lseek(2) fails ans sets errno to EBADF when fd is not an open + * file descriptor. + */ + +@@ -39,17 +39,17 @@ static void verify_llseek(unsigned int n) + { + struct tcase *tc = &tcases[n]; + +- TEST(lseek64(*tc->fd, (loff_t) 1, tc->whence)); ++ TEST(lseek(*tc->fd, (loff_t) 1, tc->whence)); + if (TST_RET != (off_t) -1) { +- tst_res(TFAIL, "lseek64(%d, 1, %d) succeeded unexpectedly (%ld)", ++ tst_res(TFAIL, "lseek(%d, 1, %d) succeeded unexpectedly (%ld)", + *tc->fd, tc->whence, TST_RET); + return; + } + if (TST_ERR == tc->exp_err) { +- tst_res(TPASS | TTERRNO, "lseek64(%d, 1, %d) failed as expected", ++ tst_res(TPASS | TTERRNO, "lseek(%d, 1, %d) failed as expected", + *tc->fd, tc->whence); + } else { +- tst_res(TFAIL | TTERRNO, "lseek64(%d, 1, %d) failed " ++ tst_res(TFAIL | TTERRNO, "lseek(%d, 1, %d) failed " + "unexpectedly, expected %s", *tc->fd, tc->whence, + tst_strerrno(tc->exp_err)); + } +diff --git a/testcases/kernel/syscalls/llseek/llseek03.c b/testcases/kernel/syscalls/llseek/llseek03.c +index d780f2af6..6c34119e5 100644 +--- a/testcases/kernel/syscalls/llseek/llseek03.c ++++ b/testcases/kernel/syscalls/llseek/llseek03.c +@@ -72,7 +72,7 @@ static const char *str_whence(int whence) + } + } + +-static void verify_lseek64(unsigned int n) ++static void verify_lseek(unsigned int n) + { + struct tcase *tc = &tcases[n]; + char read_buf[128]; +@@ -82,7 +82,7 @@ static void verify_lseek64(unsigned int n) + + SAFE_READ(1, fd, read_buf, 4); + +- TEST(lseek64(fd, tc->off, tc->whence)); ++ TEST(lseek(fd, tc->off, tc->whence)); + + if (TST_RET == -1) { + tst_res(TFAIL | TTERRNO, "llseek failed on %s ", TEST_FILE); +@@ -121,6 +121,6 @@ exit: + static struct tst_test test = { + .needs_tmpdir = 1, + .setup = setup, +- .test = verify_lseek64, ++ .test = verify_lseek, + .tcnt = ARRAY_SIZE(tcases), + }; +diff --git a/testcases/kernel/syscalls/open/Makefile b/testcases/kernel/syscalls/open/Makefile +index 044619fb8..8a916d0fa 100644 +--- a/testcases/kernel/syscalls/open/Makefile ++++ b/testcases/kernel/syscalls/open/Makefile +@@ -6,3 +6,5 @@ top_srcdir ?= ../../../.. + include $(top_srcdir)/include/mk/testcases.mk + + include $(top_srcdir)/include/mk/generic_leaf_target.mk ++ ++CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE +diff --git a/testcases/kernel/syscalls/open/open12.c b/testcases/kernel/syscalls/open/open12.c +index bdf29a9a8..c840de53d 100644 +--- a/testcases/kernel/syscalls/open/open12.c ++++ b/testcases/kernel/syscalls/open/open12.c +@@ -233,14 +233,14 @@ static void test_cloexec(void) + static void test_largefile(void) + { + int fd; +- off64_t offset; ++ off_t offset; + + fd = SAFE_OPEN(cleanup, LARGE_FILE, + O_LARGEFILE | O_RDWR | O_CREAT, 0777); + +- offset = lseek64(fd, 4.1*1024*1024*1024, SEEK_SET); ++ offset = lseek(fd, 4.1*1024*1024*1024, SEEK_SET); + if (offset == -1) +- tst_brkm(TBROK | TERRNO, cleanup, "lseek64 failed"); ++ tst_brkm(TBROK | TERRNO, cleanup, "lseek failed"); + + SAFE_WRITE(cleanup, 1, fd, LARGE_FILE, sizeof(LARGE_FILE)); + +diff --git a/testcases/kernel/syscalls/openat/Makefile b/testcases/kernel/syscalls/openat/Makefile +index 044619fb8..8a916d0fa 100644 +--- a/testcases/kernel/syscalls/openat/Makefile ++++ b/testcases/kernel/syscalls/openat/Makefile +@@ -6,3 +6,5 @@ top_srcdir ?= ../../../.. + include $(top_srcdir)/include/mk/testcases.mk + + include $(top_srcdir)/include/mk/generic_leaf_target.mk ++ ++CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE +diff --git a/testcases/kernel/syscalls/openat/openat02.c b/testcases/kernel/syscalls/openat/openat02.c +index 2ce119033..f6113852a 100644 +--- a/testcases/kernel/syscalls/openat/openat02.c ++++ b/testcases/kernel/syscalls/openat/openat02.c +@@ -22,7 +22,7 @@ + * 2)openat() succeeds to enable the close-on-exec flag for a + * file descriptor, when 'flags' is set to O_CLOEXEC. + * 3)openat() succeeds to allow files whose sizes cannot be +- * represented in an off_t but can be represented in an off64_t ++ * represented in an off_t but can be represented in an off_t + * to be opened, when 'flags' is set to O_LARGEFILE. + * 4)openat() succeeds to not update the file last access time + * (st_atime in the inode) when the file is read, when 'flags' +@@ -193,12 +193,12 @@ void testfunc_cloexec(void) + void testfunc_largefile(void) + { + int fd; +- off64_t offset; ++ off_t offset; + + fd = SAFE_OPEN(cleanup, LARGE_FILE, + O_LARGEFILE | O_RDWR | O_CREAT, 0777); + +- offset = lseek64(fd, 4.1*1024*1024*1024, SEEK_SET); ++ offset = lseek(fd, 4.1*1024*1024*1024, SEEK_SET); + if (offset == -1) + tst_brkm(TBROK | TERRNO, cleanup, "lseek64 failed"); + +diff --git a/testcases/kernel/syscalls/sync_file_range/Makefile b/testcases/kernel/syscalls/sync_file_range/Makefile +index 044619fb8..8a916d0fa 100644 +--- a/testcases/kernel/syscalls/sync_file_range/Makefile ++++ b/testcases/kernel/syscalls/sync_file_range/Makefile +@@ -6,3 +6,5 @@ top_srcdir ?= ../../../.. + include $(top_srcdir)/include/mk/testcases.mk + + include $(top_srcdir)/include/mk/generic_leaf_target.mk ++ ++CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE +diff --git a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c +index 187ef6071..47188aa48 100644 +--- a/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c ++++ b/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c +@@ -44,8 +44,8 @@ static int bfd = -1; + + struct test_case { + int *fd; +- off64_t offset; +- off64_t nbytes; ++ off_t offset; ++ off_t nbytes; + unsigned int flags; + int error; + } tcases[] = { +diff --git a/testcases/kernel/syscalls/sync_file_range/sync_file_range02.c b/testcases/kernel/syscalls/sync_file_range/sync_file_range02.c +index 5da751c70..28a8156c8 100644 +--- a/testcases/kernel/syscalls/sync_file_range/sync_file_range02.c ++++ b/testcases/kernel/syscalls/sync_file_range/sync_file_range02.c +@@ -31,10 +31,10 @@ + + struct testcase { + char *fname; +- off64_t sync_off; +- off64_t sync_size; ++ off_t sync_off; ++ off_t sync_size; + size_t exp_sync_size; +- off64_t write_off; ++ off_t write_off; + size_t write_size_mb; + const char *desc; + }; diff --git a/meta/recipes-extended/ltp/ltp_20220930.bb b/meta/recipes-extended/ltp/ltp_20220930.bb index 405b17b637..568a6320c1 100644 --- a/meta/recipes-extended/ltp/ltp_20220930.bb +++ b/meta/recipes-extended/ltp/ltp_20220930.bb @@ -29,6 +29,7 @@ SRCREV = "b763f81998f19f783982d3937d1fd05bcf649c16" SRC_URI = "git://github.com/linux-test-project/ltp.git;branch=master;protocol=https \ file://0001-Remove-OOM-tests-from-runtest-mm.patch \ file://disable_hanging_tests.patch \ + file://0001-testcases-Fix-largefile-support.patch \ " S = "${WORKDIR}/git" From patchwork Thu Dec 15 08:45:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9406BC4708D for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mx.groups.io with SMTP id smtpd.web10.128336.1671093952569947442 for ; Thu, 15 Dec 2022 00:45:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LHDnHjhQ; spf=pass (domain: gmail.com, ip: 209.85.214.175, mailfrom: raj.khem@gmail.com) Received: by mail-pl1-f175.google.com with SMTP id m4so6142215pls.4 for ; Thu, 15 Dec 2022 00:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nkkuB68168ItzixAuKDo1BraSx+ThM4RqzNiLsvKXaQ=; b=LHDnHjhQyTxKpNZyxCjqHozvFLr5te01ehmTZAYXdCr2Ug2HBtYcBJaJD7JaGzEvc2 xFLVlapc07u6w5QbNv9HslNWMiUmYEOHBefmygZs/yhPPjYkgVnvGKOhAqbr7EDyLSKe s1/simSeEUq1uWgTiKKM/p7Vhyur43hvmEZj2fWByS2i/3NFMUGSLtB1TgNyMabxN1+r eQWKn3u5+++2avrIUdi0YEY+PRerJV0vaBtCVqXRqPfmBm83jrClL4+ovaa2LyG/KQpW uJFzMV+uQCt8LQXf/p0mrwR5vdUil3N5WCVaMcA+syxXSBK6X2WrHdY7A1DMF5VBk1Hq ch7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nkkuB68168ItzixAuKDo1BraSx+ThM4RqzNiLsvKXaQ=; b=yvhmFW8e+jl6BntOyUDnCEW9foa7UbVAs/gx9uuHkxhsipm17t+AtLWRvp6lQ76fHt TDeIKAoG966Ph8mfOcnE78NBqyYgX17qddlVTcFy+LDVaj5OVQcHhivGRm+2zk1hnQQq OxEIzf2Xvfv/q24byrnoIlFxp1LfihcxIcD4j3gIPYaWH3DVIj9D3Q+0E42aEnjkCZMX L2mwA+SlD6pUL1qNjq9yWE7hgxYCyxQr7U7AvuA/SCM4zA58u9B4kGEf9Xm+Xrhyb8Z9 bTPJPCouomozhQjX0NAxXWCZ2QLJXNN0PsUOs+dME5JVa/mDFg1v72HCTlW4wq504S2q 6olQ== X-Gm-Message-State: ANoB5pkkiLu4GdlOg7wMQs4CgnCy3kMe7k3PEFau1T4M52iwKwPFL3Ms Rn3vm2Fu62Ko2zHWpjBYj60MujrX1mI= X-Google-Smtp-Source: AA0mqf6Va7eRgNDL7wsotlS7oBXkvvk4mJr6SHZ/6geWHnK/tBH5mjhawwYNgx595J/ZymlX6jHD/A== X-Received: by 2002:a17:902:7e47:b0:18f:5bc0:5893 with SMTP id a7-20020a1709027e4700b0018f5bc05893mr20532477pln.0.1671093953450; Thu, 15 Dec 2022 00:45:53 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:53 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 07/11] acl: Enable largefile support by default Date: Thu, 15 Dec 2022 00:45:42 -0800 Message-Id: <20221215084546.125368-7-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174569 This ensures right flags are passed so enable it. Musl and decoupled these APIs from _GNU_SOURCE and now are only available when _LARGEFILE64_SOURCE macro is enabled Signed-off-by: Khem Raj --- ...rtable-version-of-dirent-and-readdir.patch | 39 +++++++++++++++++++ meta/recipes-support/attr/acl_2.3.1.bb | 3 ++ 2 files changed, 42 insertions(+) create mode 100644 meta/recipes-support/attr/acl/0001-chacl-Use-portable-version-of-dirent-and-readdir.patch diff --git a/meta/recipes-support/attr/acl/0001-chacl-Use-portable-version-of-dirent-and-readdir.patch b/meta/recipes-support/attr/acl/0001-chacl-Use-portable-version-of-dirent-and-readdir.patch new file mode 100644 index 0000000000..775675e1f2 --- /dev/null +++ b/meta/recipes-support/attr/acl/0001-chacl-Use-portable-version-of-dirent-and-readdir.patch @@ -0,0 +1,39 @@ +From 1a5671a4eb13b81b98c3e71f00370781563f66d8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 10 Nov 2022 17:57:24 -0800 +Subject: [PATCH] chacl: Use portable version of dirent and readdir + +Using 64bit versions on 32bit architectures should be enabled with +--enable-largefile, this makes it portable across musl and glibc + +Upstream-Status: Backport [https://git.savannah.nongnu.org/cgit/acl.git/commit/?id=2b42f64737adf6a2ddd491213580d6e9cdd2f5af] +Signed-off-by: Khem Raj +--- + tools/chacl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/chacl.c b/tools/chacl.c +index 525a7ff..8fff875 100644 +--- a/tools/chacl.c ++++ b/tools/chacl.c +@@ -320,7 +320,7 @@ walk_dir(acl_t acl, acl_t dacl, const char *fname) + { + int failed = 0; + DIR *dir; +- struct dirent64 *d; ++ struct dirent *d; + char *name; + + if ((dir = opendir(fname)) == NULL) { +@@ -332,7 +332,7 @@ walk_dir(acl_t acl, acl_t dacl, const char *fname) + return(0); /* got a file, not an error */ + } + +- while ((d = readdir64(dir)) != NULL) { ++ while ((d = readdir(dir)) != NULL) { + /* skip "." and ".." entries */ + if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0) + continue; +-- +2.38.1 + diff --git a/meta/recipes-support/attr/acl_2.3.1.bb b/meta/recipes-support/attr/acl_2.3.1.bb index aca04a9aac..5fb8f9ae35 100644 --- a/meta/recipes-support/attr/acl_2.3.1.bb +++ b/meta/recipes-support/attr/acl_2.3.1.bb @@ -19,12 +19,15 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/acl/${BP}.tar.gz \ file://run-ptest \ file://0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch \ file://0001-test-patch-out-failing-bits.patch \ + file://0001-chacl-Use-portable-version-of-dirent-and-readdir.patch \ " SRC_URI[sha256sum] = "760c61c68901b37fdd5eefeeaf4c0c7a26bdfdd8ac747a1edff1ce0e243c11af" inherit autotools gettext ptest +EXTRA_OECONF += "--enable-largefile" + PACKAGES =+ "lib${BPN}" FILES:lib${BPN} = "${libdir}/lib*${SOLIBS}" From patchwork Thu Dec 15 08:45:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16766 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8625FC25B04 for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.web10.128335.1671093951750537163 for ; Thu, 15 Dec 2022 00:45:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eBhnrzz1; spf=pass (domain: gmail.com, ip: 209.85.216.50, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f50.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so2042244pjj.2 for ; Thu, 15 Dec 2022 00:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u5FR59x43KKvoKLz00M0bujHhtlEJiVX8piZWEngr/g=; b=eBhnrzz1VSiUAQS5mkd4iWkA7XBYUJ0YHqa6Ismr3g4fositS5er3mMsiVA6Z7gXTB EnuLhrv6v2YI4moAyxfbuwCMvJbJ2Soq4tkGzz8Dhum6IDoUtp+RrCxfKx1UrMnUO0YU 37t1nXhzq1CaQXY8xDqv7Buz4mp5dAMVF2L/o4sgcV56zMxG2Vs6p/BTKM/XeC12h3WX MZiUXBCr2gHxqQAylmQLwr2nlkRVU3S2CqeCz+pzzbCIIQEVSESUxjK8o8BrcdE9Ho2j 3yU4GChdrc6Jfy1ZhV693UX8wap6L3s/PP/VG3se2S18FpdYsEfZU6xqLCTaeQ0IhMuG ciaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u5FR59x43KKvoKLz00M0bujHhtlEJiVX8piZWEngr/g=; b=UV8+y9dVAY9Ff/w9p8n2SZwYSCyhsmDIK7pE28f2WXf5Ss97E1TuSApPdbMcB2ewHP HI5SmFxXkVBrvhIfMr5osdVrC7RsC7iSGgZg/jcqPsgq4pFzKGXj61TUMLtaRrMp8tro MRlbRENJ9wAUDRslZjERDTt3ZV2+m5kmTGV76+AzfyoMDF7vV4SroTFYSFCHTjfE3UvH dankikZyx9gKgNUtvAbm3F19KMylH0WWgHQfdir+GvTwxq6Ra2GJGm+lzhIOMfgtWfXG Q2GILOSG2QISuxB3wNTkFwT3nqP0L/wg3TBeQHF8r4uGdBwDg+B/7ysoE30I52mBBQmE Re5w== X-Gm-Message-State: ANoB5plgFEUkV4iL7M38ldt5FhkQzoYB+9OaC/gXEOF9pj9/HNTxk7IZ hWyzZfD8VP763oHbgWhWblvwWp8fNJ8= X-Google-Smtp-Source: AA0mqf7EI/5KkcVQFfG+W4tHWhAQT6j/T8vECHHUedhyggegwq2fDHQT/okTx9gENtXd7EBGL/H8mA== X-Received: by 2002:a17:903:1209:b0:185:441e:90b4 with SMTP id l9-20020a170903120900b00185441e90b4mr39383310plh.26.1671093954300; Thu, 15 Dec 2022 00:45:54 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:54 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 08/11] e2fsprogs: Do not use 64bit functions for largefile support Date: Thu, 15 Dec 2022 00:45:43 -0800 Message-Id: <20221215084546.125368-8-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174570 Using -D_FILE_OFFSET_BITS=64 already makes the normal function behave like 64bit variants. Moreover it makes them portable across libc Ensure that right lseek function is used with _FILE_OFFSET_BITS = 64 Refresh patches with devtool Signed-off-by: Khem Raj --- ...-to-enable-disable-largefile-support.patch | 57 +++++++++++++++++++ ...t-lseek-when-_FILE_OFFSET_BITS-is-64.patch | 37 ++++++++++++ ...-missing-check-for-permission-denied.patch | 2 +- .../e2fsprogs/e2fsprogs/quiet-debugfs.patch | 2 +- .../e2fsprogs/e2fsprogs_1.46.5.bb | 4 +- 5 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-Add-option-to-enable-disable-largefile-support.patch create mode 100644 meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-ext2fs-Use-64bit-lseek-when-_FILE_OFFSET_BITS-is-64.patch diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-Add-option-to-enable-disable-largefile-support.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-Add-option-to-enable-disable-largefile-support.patch new file mode 100644 index 0000000000..5e3730ca40 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-Add-option-to-enable-disable-largefile-support.patch @@ -0,0 +1,57 @@ +From 6fab3346d448298a24cee1faeb5fc8507a3b9712 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 10 Nov 2022 20:34:54 -0800 +Subject: [PATCH] Add option to enable/disable largefile support + +fallocate can be used to have 64bit off_t provided its compiled with +_FILE_OFFSET_BITS=64 which will be added automatically when +--enable-largefile is used. + +Upstream-Status: Submitted [https://sourceforge.net/p/e2fsprogs/code/merge-requests/4/] +Signed-off-by: Khem Raj +--- + configure.ac | 3 +++ + misc/e4defrag.c | 6 +----- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index dff3d1ca..ec1c5b64 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1800,6 +1800,9 @@ OS_IO_FILE="" + ;; + esac] + AC_SUBST(OS_IO_FILE) ++ ++AC_SYS_LARGEFILE ++ + dnl + dnl Make our output files, being sure that we create the some miscellaneous + dnl directories +diff --git a/misc/e4defrag.c b/misc/e4defrag.c +index 86e97ee3..e7175c37 100644 +--- a/misc/e4defrag.c ++++ b/misc/e4defrag.c +@@ -195,10 +195,6 @@ static struct frag_statistic_ino frag_rank[SHOW_FRAG_FILES]; + #error posix_fadvise not available! + #endif + +-#ifndef HAVE_FALLOCATE64 +-#error fallocate64 not available! +-#endif /* ! HAVE_FALLOCATE64 */ +- + /* + * get_mount_point() - Get device's mount point. + * +@@ -1568,7 +1564,7 @@ static int file_defrag(const char *file, const struct stat64 *buf, + /* Allocate space for donor inode */ + orig_group_tmp = orig_group_head; + do { +- ret = fallocate64(donor_fd, 0, ++ ret = fallocate(donor_fd, 0, + (ext2_loff_t)orig_group_tmp->start->data.logical * block_size, + (ext2_loff_t)orig_group_tmp->len * block_size); + if (ret < 0) { +-- +2.38.1 + diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-ext2fs-Use-64bit-lseek-when-_FILE_OFFSET_BITS-is-64.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-ext2fs-Use-64bit-lseek-when-_FILE_OFFSET_BITS-is-64.patch new file mode 100644 index 0000000000..a219296b89 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-ext2fs-Use-64bit-lseek-when-_FILE_OFFSET_BITS-is-64.patch @@ -0,0 +1,37 @@ +From 1a8aaa8ff7f4aca68b5ae964458e49ab16b4315f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Dec 2022 20:56:44 -0800 +Subject: [PATCH] ext2fs: Use 64bit lseek when _FILE_OFFSET_BITS is 64 + +Use lseek() with 64bit off_t when _FILE_OFFSET_BITS is 64 +this fixes build with musl where there is no _llseek but lseek +is using off_t which is 64bit on musl + +Upstream-Status: Submitted [https://sourceforge.net/p/e2fsprogs/code/merge-requests/4/] +Signe-off-by: Khem Raj +--- + lib/ext2fs/llseek.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c +index 922a0d56..45f21d09 100644 +--- a/lib/ext2fs/llseek.c ++++ b/lib/ext2fs/llseek.c +@@ -51,7 +51,7 @@ extern long long llseek (int fd, long long offset, int origin); + + #else /* ! HAVE_LLSEEK */ + +-#if SIZEOF_LONG == SIZEOF_LONG_LONG ++#if SIZEOF_LONG == SIZEOF_LONG_LONG || _FILE_OFFSET_BITS+0 == 64 + + #define my_llseek lseek + +@@ -69,7 +69,7 @@ static int _llseek (unsigned int, unsigned long, + + static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high, + unsigned long, offset_low,ext2_loff_t *,result, +- unsigned int, origin) ++ unsigned int, origin); + #endif + + static ext2_loff_t my_llseek (int fd, ext2_loff_t offset, int origin) diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch index 29078f9dd3..92bd0d0c1f 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch @@ -1,4 +1,4 @@ -From 22d7557905534d9e1b39f7d2a6d2036a40bf0c4e Mon Sep 17 00:00:00 2001 +From cce489c96aa3f4272a19d2137c2a46b439636712 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Wed, 10 Aug 2016 11:19:44 +0800 Subject: [PATCH] Fix missing check for permission denied. diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch index 902a369eb0..d695580c92 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch @@ -1,4 +1,4 @@ -From 5408b6463ee700a080a15102bccccdeb2615d734 Mon Sep 17 00:00:00 2001 +From 20bf59365646af0466c1910e8763b352380b26d6 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 23 Dec 2013 13:38:34 +0000 Subject: [PATCH] e2fsprogs: silence debugfs diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.46.5.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.46.5.bb index 5b2d1921f0..ceceb7edcc 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.46.5.bb +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.46.5.bb @@ -5,6 +5,8 @@ SRC_URI += "file://remove.ldconfig.call.patch \ file://ptest.patch \ file://mkdir_p.patch \ file://extents.patch \ + file://0001-Add-option-to-enable-disable-largefile-support.patch \ + file://0001-ext2fs-Use-64bit-lseek-when-_FILE_OFFSET_BITS-is-64.patch \ " SRC_URI:append:class-native = " \ file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ @@ -17,7 +19,7 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P\d+\.\d+(\.\d+)*)$" EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \ --enable-elf-shlibs --disable-libuuid --disable-uuidd \ --disable-libblkid --enable-verbose-makecmds \ - --with-crond-dir=no" + --enable-largefile --with-crond-dir=no" EXTRA_OECONF:darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" From patchwork Thu Dec 15 08:45:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87300C00145 for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mx.groups.io with SMTP id smtpd.web10.128340.1671093955902582665 for ; Thu, 15 Dec 2022 00:45:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pAybzvw0; spf=pass (domain: gmail.com, ip: 209.85.216.48, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f48.google.com with SMTP id gt4so9773053pjb.1 for ; Thu, 15 Dec 2022 00:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IO0lH2E9XbJ0meYv+2RvXWExKPNoCXBs7CJjDH73JU8=; b=pAybzvw0BxeZtCyKsojC1//8+R6OLPAgn81KNJQtbcZb5HeZmeYngPovgMr2ez4ssW sguIitib5TeCCPh9Jmc8RHqxm1GxQ3cbRskoVQ6OpQni7Sxh20/4b15V5wCZr4DusR5y oZZknjToORPXcTB2GwpZ3YOddW5so8M4jXRV+gBHPPxaJoZzfrekN7fUcR/mblXZMZSJ Zz8ntmgenwoZ61jWwiQTtC18rXc5ZhnUrqD9/AujBemcT0FsW7pZmd2CrYujYxXvpTVC qYW8rYAMxNLGrBHET25YpPFh3Oo4w7tY1xEyX1FiIBDumxCQNoN74YH2igAvFRtBnUGj ALfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IO0lH2E9XbJ0meYv+2RvXWExKPNoCXBs7CJjDH73JU8=; b=P5929qKeEGGcNg3fsM0ZpQq1nCK6hREzrqmbd12hbh+DmRcUM2Zi/JJ/0ok8kWZyYu yBc2J2v0BDVR9FEdHRqksZGILlfAYEZycqjOhJTWTIhsKfYCNWFtE8uUl5WtyXCNecYI pyNgfAv5/Ru8/MCHNUmpwfyztrzx2/e7Lah/PfpB8U7qf0WmML3l65/DgdVTXw4UiQzP Up9jLhEZMvC4I8Q1EqRNKgC8sirPWspn8ib65S5cQ1Eoe4kIB6jYkS1adNi8E8B+r2NJ fEQ7AtsOik6bB0yBwG4M1FW0PVSIuK6L5L+x3dos7iWC06HtXWYEPLp0gRs8l9q1owjC 6VNA== X-Gm-Message-State: ANoB5pnqnpElzcy2YpG10j+Gn/FibVxGU91g1Y2Sy68UqIUPfKsldtXI IByhmYFNcTysK753a1AjSfLbmOt/uuc= X-Google-Smtp-Source: AA0mqf7Z8lH2nO8sHmbZRMPYiGGrMj+3ahahUgBaQIF1x6wmyqRutYxMkBrW7VXil6jXsx490a8+aA== X-Received: by 2002:a17:902:7242:b0:18f:a4e1:9908 with SMTP id c2-20020a170902724200b0018fa4e19908mr14384370pll.15.1671093955104; Thu, 15 Dec 2022 00:45:55 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:54 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 09/11] libpciaccess: Do not use 64bit functions for largefile support Date: Thu, 15 Dec 2022 00:45:44 -0800 Message-Id: <20221215084546.125368-9-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174571 Using -D_FILE_OFFSET_BITS=64 already makes the normal function behave like 64bit variants. Moreover it makes them portable across libc Signed-off-by: Khem Raj --- ...pwrite-pread-instead-of-64bit-versio.patch | 39 +++++++++++++++++++ .../xorg-lib/libpciaccess_0.17.bb | 2 + 2 files changed, 41 insertions(+) create mode 100644 meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch b/meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch new file mode 100644 index 0000000000..512a473e20 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch @@ -0,0 +1,39 @@ +From d20ff4f2e4feaafa6a6191b9cae3815b85617943 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 11 Nov 2022 11:15:58 -0800 +Subject: [PATCH] linux_sysfs: Use pwrite/pread instead of 64bit versions + +pread64/pwrite64 are aliased to pread/pwrite when largefile support is +enabled e.g. using _FILE_OFFSET_BITS=64 macro + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/merge_requests/26] +Signed-off-by: Khem Raj +--- + src/linux_sysfs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c +index d62f48c..20c800e 100644 +--- a/src/linux_sysfs.c ++++ b/src/linux_sysfs.c +@@ -462,7 +462,7 @@ pci_device_linux_sysfs_read( struct pci_device * dev, void * data, + + + while ( temp_size > 0 ) { +- const ssize_t bytes = pread64( fd, data_bytes, temp_size, offset ); ++ const ssize_t bytes = pread( fd, data_bytes, temp_size, offset ); + + /* If zero bytes were read, then we assume it's the end of the + * config file. +@@ -522,7 +522,7 @@ pci_device_linux_sysfs_write( struct pci_device * dev, const void * data, + + + while ( temp_size > 0 ) { +- const ssize_t bytes = pwrite64( fd, data_bytes, temp_size, offset ); ++ const ssize_t bytes = pwrite( fd, data_bytes, temp_size, offset ); + + /* If zero bytes were written, then we assume it's the end of the + * config file. +-- +2.38.1 + diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb b/meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb index 06c30384ab..309354e872 100644 --- a/meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb +++ b/meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb @@ -5,6 +5,8 @@ PCI bus and devices in a platform-independent way." require xorg-lib-common.inc +SRC_URI += "file://0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch" + XORG_EXT = "tar.xz" SRC_URI[sha256sum] = "74283ba3c974913029e7a547496a29145b07ec51732bbb5b5c58d5025ad95b73" From patchwork Thu Dec 15 08:45:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D04EC4167B for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web11.129135.1671093956760953279 for ; Thu, 15 Dec 2022 00:45:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NQktXxYP; spf=pass (domain: gmail.com, ip: 209.85.216.46, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f46.google.com with SMTP id 3-20020a17090a098300b00219041dcbe9so2006515pjo.3 for ; Thu, 15 Dec 2022 00:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eHNt5jY3vG78lhBdIvEtjgGICOxqpe5vcWWoWiTu+ec=; b=NQktXxYPJyz3+p8YXEHESA3ODiub0XzUkWxeijxkqwgazMj1CzzcT2Ct0lusZqgzqN 2yjOkP8TXvpuLv18aNH9snYV6W8i6GTlQRS6U2TllmaZTh5FgLrVs/9Uc271QPWlTUZu vqRk/utI+WNfDAyENg5NrKcYU76oRdK3FI7un814UlKRfysNHs/6kchjRXYHUbv82Rn6 fj2Ed7s3nYgB4LurFYd4ujp6Lqj0oVOlnrDihKMxZtQD4lMq4IZ3slTxqKAxUD6cr12T XoJQ93igEl8qO2uDMyRDQHUxHPngaEhnbJiZBOPOYgy9BZIaKzuWpDxrcre5MARfmW2I fPbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eHNt5jY3vG78lhBdIvEtjgGICOxqpe5vcWWoWiTu+ec=; b=SFIp1uBiR3SnyFB68tXIwsX+6TJ2PUaYNqqYZqsqphDdpwRcx9k5pctTvPMPuzoYjV C0RCVhGIpPm3TFqPsjnXkDp5wNyHajcbkJf0O9P1j8som3kPiDBsPEVWUH9f1/jBu5Zn gcQPEeoV3gTGyxVu+lZV0BSaPS36rFMIOnVyAaQGiqog95Xabd8WPFhLdmQ6dZTtvcOm mtKSF6XS4vZjwC1+EAaSVAR0xnN2una6+uDVsT/jk8XjF9Vv2b9xBz/MCmcjG8qVAb2B IgiZ7hGaMtbUhy8tOr2O+LRJcnFlfGg4vvauEGY9f5Ee1NjL18Fx5LriSHyzjpLZbipL fS8Q== X-Gm-Message-State: ANoB5pktTmpewMPj/gSCvfvcRvgbXqtMB8QwCvK9oAOZd1M230zDcYNl 0Cks97BEIZSFDIPdRHaNTaWfM5KgK1E= X-Google-Smtp-Source: AA0mqf71YYiu+hf1tcJbcvPzacz3/n8Se3sDgwL98dhR+qmQhIZzbQCm8e9q0ikFph7xq2XX5VflUA== X-Received: by 2002:a17:903:248b:b0:189:c8d9:ed30 with SMTP id p11-20020a170903248b00b00189c8d9ed30mr26900088plw.24.1671093955923; Thu, 15 Dec 2022 00:45:55 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:55 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 10/11] mdadm: Use _FILE_OFFSET_BITS to use largefile support Date: Thu, 15 Dec 2022 00:45:45 -0800 Message-Id: <20221215084546.125368-10-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174572 Signed-off-by: Khem Raj --- ...FILE_OFFSET_BITS-to-enable-largefile.patch | 147 ++++++++++++++++++ meta/recipes-extended/mdadm/mdadm_4.2.bb | 1 + 2 files changed, 148 insertions(+) create mode 100644 meta/recipes-extended/mdadm/files/0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch diff --git a/meta/recipes-extended/mdadm/files/0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch b/meta/recipes-extended/mdadm/files/0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch new file mode 100644 index 0000000000..142ed355ef --- /dev/null +++ b/meta/recipes-extended/mdadm/files/0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch @@ -0,0 +1,147 @@ +From 6b861a267a6ef6f60f6cc21e4c8e6d7cdd2451dc Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 10 Nov 2022 12:31:22 -0800 +Subject: [PATCH] restripe.c: Use _FILE_OFFSET_BITS to enable largefile support + +Instead of using the lseek64 and friends, its better to enable it via +the feature macro _FILE_OFFSET_BITS = 64 and let the C library deal with +the width of types + +Upstream-Status: Submitted [https://lore.kernel.org/linux-raid/20221110225546.337164-1-raj.khem@gmail.com/] +Signed-off-by: Khem Raj +--- + restripe.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/restripe.c ++++ b/restripe.c +@@ -22,6 +22,9 @@ + * Email: + */ + ++/* Enable largefile support */ ++#define _FILE_OFFSET_BITS 64 ++ + #include "mdadm.h" + #include + +@@ -581,7 +584,7 @@ int save_stripes(int *source, unsigned l + raid_disks, level, layout); + if (dnum < 0) abort(); + if (source[dnum] < 0 || +- lseek64(source[dnum], ++ lseek(source[dnum], + offsets[dnum] + offset, 0) < 0 || + read(source[dnum], buf+disk * chunk_size, + chunk_size) != chunk_size) { +@@ -754,8 +757,8 @@ int restore_stripes(int *dest, unsigned + raid_disks, level, layout); + if (src_buf == NULL) { + /* read from file */ +- if (lseek64(source, read_offset, 0) != +- (off64_t)read_offset) { ++ if (lseek(source, read_offset, 0) != ++ (off_t)read_offset) { + rv = -1; + goto abort; + } +@@ -816,7 +819,7 @@ int restore_stripes(int *dest, unsigned + } + for (i=0; i < raid_disks ; i++) + if (dest[i] >= 0) { +- if (lseek64(dest[i], ++ if (lseek(dest[i], + offsets[i]+offset, 0) < 0) { + rv = -1; + goto abort; +@@ -866,7 +869,7 @@ int test_stripes(int *source, unsigned l + int disk; + + for (i = 0 ; i < raid_disks ; i++) { +- if ((lseek64(source[i], offsets[i]+start, 0) < 0) || ++ if ((lseek(source[i], offsets[i]+start, 0) < 0) || + (read(source[i], stripes[i], chunk_size) != + chunk_size)) { + free(q); +--- a/raid6check.c ++++ b/raid6check.c +@@ -22,6 +22,9 @@ + * Based on "restripe.c" from "mdadm" codebase + */ + ++/* Enable largefile support */ ++#define _FILE_OFFSET_BITS 64 ++ + #include "mdadm.h" + #include + #include +@@ -279,9 +282,9 @@ int manual_repair(int chunk_size, int sy + } + + int write_res1, write_res2; +- off64_t seek_res; ++ off_t seek_res; + +- seek_res = lseek64(source[fd1], ++ seek_res = lseek(source[fd1], + offsets[fd1] + start * chunk_size, SEEK_SET); + if (seek_res < 0) { + fprintf(stderr, "lseek failed for failed_disk1\n"); +@@ -289,7 +292,7 @@ int manual_repair(int chunk_size, int sy + } + write_res1 = write(source[fd1], blocks[failed_slot1], chunk_size); + +- seek_res = lseek64(source[fd2], ++ seek_res = lseek(source[fd2], + offsets[fd2] + start * chunk_size, SEEK_SET); + if (seek_res < 0) { + fprintf(stderr, "lseek failed for failed_disk2\n"); +@@ -374,7 +377,7 @@ int check_stripes(struct mdinfo *info, i + goto exitCheck; + } + for (i = 0 ; i < raid_disks ; i++) { +- off64_t seek_res = lseek64(source[i], offsets[i] + start * chunk_size, ++ off_t seek_res = lseek(source[i], offsets[i] + start * chunk_size, + SEEK_SET); + if (seek_res < 0) { + fprintf(stderr, "lseek to source %d failed\n", i); +--- a/swap_super.c ++++ b/swap_super.c +@@ -1,3 +1,6 @@ ++/* Enable largefile support */ ++#define _FILE_OFFSET_BITS 64 ++ + #include + #include + #include +@@ -16,8 +19,6 @@ + + #define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS) + +-extern long long lseek64(int, long long, int); +- + int main(int argc, char *argv[]) + { + int fd, i; +@@ -38,8 +39,8 @@ int main(int argc, char *argv[]) + exit(1); + } + offset = MD_NEW_SIZE_SECTORS(size) * 512LL; +- if (lseek64(fd, offset, 0) < 0LL) { +- perror("lseek64"); ++ if (lseek(fd, offset, 0) < 0LL) { ++ perror("lseek"); + exit(1); + } + if (read(fd, super, 4096) != 4096) { +@@ -68,8 +69,8 @@ int main(int argc, char *argv[]) + super[32*4+10*4 +i] = t; + } + +- if (lseek64(fd, offset, 0) < 0LL) { +- perror("lseek64"); ++ if (lseek(fd, offset, 0) < 0LL) { ++ perror("lseek"); + exit(1); + } + if (write(fd, super, 4096) != 4096) { diff --git a/meta/recipes-extended/mdadm/mdadm_4.2.bb b/meta/recipes-extended/mdadm/mdadm_4.2.bb index 19035caaec..7298860241 100644 --- a/meta/recipes-extended/mdadm/mdadm_4.2.bb +++ b/meta/recipes-extended/mdadm/mdadm_4.2.bb @@ -24,6 +24,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ file://0001-mdadm-skip-test-11spare-migration.patch \ file://0001-Fix-parsing-of-r-in-monitor-manager-mode.patch \ file://0001-Makefile-install-mdcheck.patch \ + file://0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch \ " SRC_URI[sha256sum] = "461c215670864bb74a4d1a3620684aa2b2f8296dffa06743f26dda5557acf01d" From patchwork Thu Dec 15 08:45:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 16767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 865DAC46467 for ; Thu, 15 Dec 2022 08:46:00 +0000 (UTC) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web10.128338.1671093953646276517 for ; Thu, 15 Dec 2022 00:45:57 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gRkVp9CK; spf=pass (domain: gmail.com, ip: 209.85.216.46, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f46.google.com with SMTP id t11-20020a17090a024b00b0021932afece4so2011799pje.5 for ; Thu, 15 Dec 2022 00:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iMxZo+V30+1JVj89jb6evNdwtFtHGg03/xmFpBhmAXg=; b=gRkVp9CKEC2uHymFajnb+6j1XPJNfHPxkcSzJmpS9x5ei4TWCnvP7hQjnTeLBWtSh4 9IHya2WaxITRZroN+wTow3xoz8Z3Iu66xJ1Mt9KuTMcARUAmb3iJ1rmHRSKFnCb13HIU w3Poq320LeO0GbcF69xlSKnRKX8g6R0lnUoiCwS0MC0K97cTzggjDjraQtXqFBge1b5c VNzGOwvblTmDFgwUL28Cd0i7XcZtOn47ERLOEMZYzD5So6FnQakwP9MvXAe+RX6E31N+ y819wcWOD3LOHLHXY+tpsuis77TIdwM5AIhJlL8x3xmY7mnMyhsU4lgK5YfufznFA64u Q3qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iMxZo+V30+1JVj89jb6evNdwtFtHGg03/xmFpBhmAXg=; b=8MQ26Pd56CMawopI5hJ5xBhFU19I20N/WmT4gaSNpjprY2HNr6xkMYJ9fm5zS4WynL 9Uv0ieLzRXPPtTmIokibGljZvvoFRw8umIqpbZpklZ9WN6GDHlnruwtyCmHDBpUE7RO6 DyhdFKhWM56LbJSfXvm8lR/APdFBzvvpjfdD3p9w9Fa3SoKyNwh1gzd9AGHhPw/gy4Me sjxLYB1wJSW9BvyHdukSFcZgPEkABsgt8dbjjVezQRLj5eBI2madhQw6ZY6p3QHPtGJG Krk/Sv2KzwNEwRUJ0xvybMkZgoRq1gSstMtq099loIpoy/da8s2xxlLgbu/qBgRp7lYY ewzw== X-Gm-Message-State: ANoB5pkNpR0ftoCzTXzO3bCFU/NjeuiwsStsWwoN3Q4LOPZkrwJwvAck gxgT73NfKcKxGnlMCQ+VakYQRVkNQtM= X-Google-Smtp-Source: AA0mqf6Nco+GaaMZ5RKUe3sT2uau5tqjs/tRay9Q1Hgfel9sGJBRUZWUkT0TO0i7neuTQmGyObE2yA== X-Received: by 2002:a17:903:181:b0:189:9007:ecef with SMTP id z1-20020a170903018100b001899007ecefmr40064210plg.25.1671093956765; Thu, 15 Dec 2022 00:45:56 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9181:1cf0::7d9c]) by smtp.gmail.com with ESMTPSA id z14-20020a170903018e00b00188ea79fae0sm3255723plg.48.2022.12.15.00.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 00:45:56 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 11/11] btrfs-tools: Do not use 64bit functions for largefile support Date: Thu, 15 Dec 2022 00:45:46 -0800 Message-Id: <20221215084546.125368-11-raj.khem@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221215084546.125368-1-raj.khem@gmail.com> References: <20221215084546.125368-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 15 Dec 2022 08:46:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/174573 Using -D_FILE_OFFSET_BITS=64 already makes the normal function behave like 64bit variants. Moreover it makes them portable across libc Signed-off-by: Khem Raj --- ...-ftruncate-stat-instead-of-64bit-equ.patch | 903 ++++++++++++++++++ .../btrfs-tools/btrfs-tools_6.0.2.bb | 1 + 2 files changed, 904 insertions(+) create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Use-pread-pwrite-ftruncate-stat-instead-of-64bit-equ.patch diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Use-pread-pwrite-ftruncate-stat-instead-of-64bit-equ.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Use-pread-pwrite-ftruncate-stat-instead-of-64bit-equ.patch new file mode 100644 index 0000000000..2618687088 --- /dev/null +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Use-pread-pwrite-ftruncate-stat-instead-of-64bit-equ.patch @@ -0,0 +1,903 @@ +From 37425f422e46003ed623f8e6387bed1aa5778b96 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 11 Nov 2022 11:26:05 -0800 +Subject: [PATCH] Use pread/pwrite/ftruncate/stat instead of 64bit equivalents + +64bit functions are aliases to original functions when largefile feature +is enabled via autoconf or right macro is passed on compiler cmdline + +-D_FILE_OFFSET_BITS=64 + +Upstream-Status: Submitted [https://lore.kernel.org/linux-btrfs/20221215084046.122836-1-raj.khem@gmail.com/T/#u] +Signed-off-by: Khem Raj +--- + cmds/rescue-chunk-recover.c | 4 +- + image/main.c | 14 +-- + kernel-shared/zoned.c | 6 +- + kernel-shared/zoned.h | 4 +- + mkfs/main.c | 4 +- + mkfs/rootdir.c | 10 +- + tests/fsstress.c | 192 ++++++++++++++++++------------------ + tests/fssum.c | 8 +- + 8 files changed, 121 insertions(+), 121 deletions(-) + +--- a/cmds/rescue-chunk-recover.c ++++ b/cmds/rescue-chunk-recover.c +@@ -755,7 +755,7 @@ static int scan_one_device(void *dev_sca + if (is_super_block_address(bytenr)) + bytenr += rc->sectorsize; + +- if (pread64(fd, buf->data, rc->nodesize, bytenr) < ++ if (pread(fd, buf->data, rc->nodesize, bytenr) < + rc->nodesize) + break; + +@@ -1875,7 +1875,7 @@ static int check_one_csum(int fd, u64 st + data = malloc(len); + if (!data) + return -1; +- ret = pread64(fd, data, len, start); ++ ret = pread(fd, data, len, start); + if (ret < 0 || ret != len) { + ret = -1; + goto out; +--- a/image/main.c ++++ b/image/main.c +@@ -691,7 +691,7 @@ static int flush_pending(struct metadump + if (start == BTRFS_SUPER_INFO_OFFSET) { + int fd = get_dev_fd(md->root); + +- ret = pread64(fd, async->buffer, size, start); ++ ret = pread(fd, async->buffer, size, start); + if (ret < size) { + free(async->buffer); + free(async); +@@ -1366,7 +1366,7 @@ static void write_backup_supers(int fd, + break; + btrfs_set_super_bytenr(super, bytenr); + csum_block(buf, BTRFS_SUPER_INFO_SIZE); +- ret = pwrite64(fd, buf, BTRFS_SUPER_INFO_SIZE, bytenr); ++ ret = pwrite(fd, buf, BTRFS_SUPER_INFO_SIZE, bytenr); + if (ret < BTRFS_SUPER_INFO_SIZE) { + if (ret < 0) + error( +@@ -1487,12 +1487,12 @@ static int restore_one_work(struct mdres + else + bytenr = logical; + +- ret = pwrite64(outfd, buffer + offset, chunk_size, bytenr); ++ ret = pwrite(outfd, buffer + offset, chunk_size, bytenr); + if (ret != chunk_size) + goto write_error; + + if (physical_dup) +- ret = pwrite64(outfd, buffer + offset, ++ ret = pwrite(outfd, buffer + offset, + chunk_size, physical_dup); + if (ret != chunk_size) + goto write_error; +@@ -2454,7 +2454,7 @@ static int fixup_device_size(struct btrf + } + if (S_ISREG(buf.st_mode)) { + /* Don't forget to enlarge the real file */ +- ret = ftruncate64(out_fd, dev_size); ++ ret = ftruncate(out_fd, dev_size); + if (ret < 0) { + error("failed to enlarge result image: %m"); + return -errno; +@@ -2913,7 +2913,7 @@ static int restore_metadump(const char * + goto out; + } + if (S_ISREG(st.st_mode) && st.st_size < dev_size) { +- ret = ftruncate64(fileno(out), dev_size); ++ ret = ftruncate(fileno(out), dev_size); + if (ret < 0) { + error( + "failed to enlarge result image file from %llu to %llu: %m", +@@ -3010,7 +3010,7 @@ static int update_disk_super_on_device(s + memcpy(dev_item->fsid, fs_uuid, BTRFS_UUID_SIZE); + csum_block((u8 *)&disk_super, BTRFS_SUPER_INFO_SIZE); + +- ret = pwrite64(fp, &disk_super, BTRFS_SUPER_INFO_SIZE, BTRFS_SUPER_INFO_OFFSET); ++ ret = pwrite(fp, &disk_super, BTRFS_SUPER_INFO_SIZE, BTRFS_SUPER_INFO_OFFSET); + if (ret != BTRFS_SUPER_INFO_SIZE) { + if (ret < 0) { + errno = ret; +--- a/kernel-shared/zoned.c ++++ b/kernel-shared/zoned.c +@@ -194,7 +194,7 @@ static int sb_write_pointer(int fd, stru + bytenr = ((zones[i].start + zones[i].len) + << SECTOR_SHIFT) - BTRFS_SUPER_INFO_SIZE; + +- ret = pread64(fd, buf[i], BTRFS_SUPER_INFO_SIZE, bytenr); ++ ret = pread(fd, buf[i], BTRFS_SUPER_INFO_SIZE, bytenr); + if (ret != BTRFS_SUPER_INFO_SIZE) + return -EIO; + super[i] = (struct btrfs_super_block *)&buf[i]; +@@ -515,8 +515,8 @@ size_t btrfs_sb_io(int fd, void *buf, of + /* We can call pread/pwrite if 'fd' is non-zoned device/file */ + if (zone_size_sector == 0) { + if (rw == READ) +- return pread64(fd, buf, count, offset); +- return pwrite64(fd, buf, count, offset); ++ return pread(fd, buf, count, offset); ++ return pwrite(fd, buf, count, offset); + } + + ASSERT(IS_ALIGNED(zone_size_sector, sb_size_sector)); +--- a/kernel-shared/zoned.h ++++ b/kernel-shared/zoned.h +@@ -150,9 +150,9 @@ int btrfs_wipe_temporary_sb(struct btrfs + #else + + #define sbread(fd, buf, offset) \ +- pread64(fd, buf, BTRFS_SUPER_INFO_SIZE, offset) ++ pread(fd, buf, BTRFS_SUPER_INFO_SIZE, offset) + #define sbwrite(fd, buf, offset) \ +- pwrite64(fd, buf, BTRFS_SUPER_INFO_SIZE, offset) ++ pwrite(fd, buf, BTRFS_SUPER_INFO_SIZE, offset) + + static inline int btrfs_reset_dev_zone(int fd, struct blk_zone *zone) + { +--- a/mkfs/main.c ++++ b/mkfs/main.c +@@ -453,14 +453,14 @@ static int zero_output_file(int out_fd, + /* Only zero out the first 1M */ + loop_num = SZ_1M / SZ_4K; + for (i = 0; i < loop_num; i++) { +- written = pwrite64(out_fd, buf, SZ_4K, location); ++ written = pwrite(out_fd, buf, SZ_4K, location); + if (written != SZ_4K) + ret = -EIO; + location += SZ_4K; + } + + /* Then enlarge the file to size */ +- written = pwrite64(out_fd, buf, 1, size - 1); ++ written = pwrite(out_fd, buf, 1, size - 1); + if (written < 1) + ret = -EIO; + return ret; +--- a/mkfs/rootdir.c ++++ b/mkfs/rootdir.c +@@ -340,7 +340,7 @@ static int add_file_items(struct btrfs_t + goto end; + } + +- ret_read = pread64(fd, buffer, st->st_size, bytes_read); ++ ret_read = pread(fd, buffer, st->st_size, bytes_read); + if (ret_read == -1) { + error("cannot read %s at offset %llu length %llu: %m", + path_name, bytes_read, (unsigned long long)st->st_size); +@@ -386,7 +386,7 @@ again: + + memset(eb->data, 0, sectorsize); + +- ret_read = pread64(fd, eb->data, sectorsize, file_pos + ++ ret_read = pread(fd, eb->data, sectorsize, file_pos + + bytes_read); + if (ret_read == -1) { + error("cannot read %s at offset %llu length %u: %m", +@@ -929,7 +929,7 @@ int btrfs_mkfs_shrink_fs(struct btrfs_fs + u64 new_size; + struct btrfs_device *device; + struct list_head *cur; +- struct stat64 file_stat; ++ struct stat file_stat; + int nr_devs = 0; + int ret; + +@@ -963,14 +963,14 @@ int btrfs_mkfs_shrink_fs(struct btrfs_fs + *new_size_ret = new_size; + + if (shrink_file_size) { +- ret = fstat64(device->fd, &file_stat); ++ ret = fstat(device->fd, &file_stat); + if (ret < 0) { + error("failed to stat devid %llu: %m", device->devid); + return ret; + } + if (!S_ISREG(file_stat.st_mode)) + return ret; +- ret = ftruncate64(device->fd, new_size); ++ ret = ftruncate(device->fd, new_size); + if (ret < 0) { + error("failed to truncate device file of devid %llu: %m", + device->devid); +--- a/tests/fsstress.c ++++ b/tests/fsstress.c +@@ -458,7 +458,7 @@ int get_fname(int, long, pathname_t *, f + void init_pathname(pathname_t *); + int lchown_path(pathname_t *, uid_t, gid_t); + int link_path(pathname_t *, pathname_t *); +-int lstat64_path(pathname_t *, struct stat64 *); ++int lstat_path(pathname_t *, struct stat *); + void make_freq_table(void); + int mkdir_path(pathname_t *, mode_t); + int mknod_path(pathname_t *, mode_t, dev_t); +@@ -472,9 +472,9 @@ int rename_path(pathname_t *, pathname_t + int rmdir_path(pathname_t *); + void separate_pathname(pathname_t *, char *, pathname_t *); + void show_ops(int, char *); +-int stat64_path(pathname_t *, struct stat64 *); ++int stat_path(pathname_t *, struct stat *); + int symlink_path(const char *, pathname_t *); +-int truncate64_path(pathname_t *, off64_t); ++int truncate_path(pathname_t *, off64_t); + int unlink_path(pathname_t *); + void usage(void); + void write_freq(void); +@@ -998,12 +998,12 @@ void + check_cwd(void) + { + #ifdef DEBUG +- struct stat64 statbuf; ++ struct stat statbuf; + int ret; + +- ret = stat64(".", &statbuf); ++ ret = stat(".", &statbuf); + if (ret != 0) { +- fprintf(stderr, "fsstress: check_cwd stat64() returned %d with errno: %d (%m)\n", ++ fprintf(stderr, "fsstress: check_cwd stat() returned %d with errno: %d (%m)\n", + ret, errno); + goto out; + } +@@ -1171,7 +1171,7 @@ again: + void + doproc(void) + { +- struct stat64 statbuf; ++ struct stat statbuf; + char buf[10]; + char cmd[64]; + opnum_t opno; +@@ -1182,7 +1182,7 @@ doproc(void) + dividend = (operations + execute_freq) / (execute_freq + 1); + sprintf(buf, "p%x", procid); + (void)mkdir(buf, 0777); +- if (chdir(buf) < 0 || stat64(".", &statbuf) < 0) { ++ if (chdir(buf) < 0 || stat(".", &statbuf) < 0) { + perror(buf); + _exit(1); + } +@@ -1214,7 +1214,7 @@ doproc(void) + * the forced shutdown happened. + */ + if (errtag != 0 && opno % 100 == 0) { +- rval = stat64(".", &statbuf); ++ rval = stat(".", &statbuf); + if (rval == EIO) { + fprintf(stderr, "Detected EIO\n"); + goto errout; +@@ -1537,18 +1537,18 @@ link_path(pathname_t *name1, pathname_t + } + + int +-lstat64_path(pathname_t *name, struct stat64 *sbuf) ++lstat_path(pathname_t *name, struct stat *sbuf) + { + char buf[NAME_MAX + 1]; + pathname_t newname; + int rval; + +- rval = lstat64(name->path, sbuf); ++ rval = lstat(name->path, sbuf); + if (rval >= 0 || errno != ENAMETOOLONG) + return rval; + separate_pathname(name, buf, &newname); + if (chdir(buf) == 0) { +- rval = lstat64_path(&newname, sbuf); ++ rval = lstat_path(&newname, sbuf); + assert(chdir("..") == 0); + } + free_pathname(&newname); +@@ -1870,18 +1870,18 @@ show_ops(int flag, char *lead_str) + } + + int +-stat64_path(pathname_t *name, struct stat64 *sbuf) ++stat_path(pathname_t *name, struct stat *sbuf) + { + char buf[NAME_MAX + 1]; + pathname_t newname; + int rval; + +- rval = stat64(name->path, sbuf); ++ rval = stat(name->path, sbuf); + if (rval >= 0 || errno != ENAMETOOLONG) + return rval; + separate_pathname(name, buf, &newname); + if (chdir(buf) == 0) { +- rval = stat64_path(&newname, sbuf); ++ rval = stat_path(&newname, sbuf); + assert(chdir("..") == 0); + } + free_pathname(&newname); +@@ -1913,18 +1913,18 @@ symlink_path(const char *name1, pathname + } + + int +-truncate64_path(pathname_t *name, off64_t length) ++truncate_path(pathname_t *name, off64_t length) + { + char buf[NAME_MAX + 1]; + pathname_t newname; + int rval; + +- rval = truncate64(name->path, length); ++ rval = truncate(name->path, length); + if (rval >= 0 || errno != ENAMETOOLONG) + return rval; + separate_pathname(name, buf, &newname); + if (chdir(buf) == 0) { +- rval = truncate64_path(&newname, length); ++ rval = truncate_path(&newname, length); + assert(chdir("..") == 0); + } + free_pathname(&newname); +@@ -2026,7 +2026,7 @@ non_btrfs_freq(const char *path) + ops[btrfs_ops[i]].freq = 0; + } + +-void inode_info(char *str, size_t sz, struct stat64 *s, int verbose) ++void inode_info(char *str, size_t sz, struct stat *s, int verbose) + { + if (verbose) + snprintf(str, sz, "[%ld %ld %d %d %lld %lld]", +@@ -2101,7 +2101,7 @@ allocsp_f(opnum_t opno, long r) + struct xfs_flock64 fl; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + +@@ -2122,9 +2122,9 @@ allocsp_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: allocsp - fstat64 %s failed %d\n", ++ printf("%d/%lld: allocsp - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -2160,7 +2160,7 @@ do_aio_rw(opnum_t opno, long r, int flag + size_t len; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + char *dio_env; +@@ -2184,9 +2184,9 @@ do_aio_rw(opnum_t opno, long r, int flag + procid, opno, f.path, e); + goto aio_out; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: do_aio_rw - fstat64 %s failed %d\n", ++ printf("%d/%lld: do_aio_rw - fstat %s failed %d\n", + procid, opno, f.path, errno); + goto aio_out; + } +@@ -2278,7 +2278,7 @@ do_uring_rw(opnum_t opno, long r, int fl + size_t len; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + struct io_uring_sqe *sqe; +@@ -2304,9 +2304,9 @@ do_uring_rw(opnum_t opno, long r, int fl + procid, opno, f.path, e); + goto uring_out; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: do_uring_rw - fstat64 %s failed %d\n", ++ printf("%d/%lld: do_uring_rw - fstat %s failed %d\n", + procid, opno, f.path, errno); + goto uring_out; + } +@@ -2522,7 +2522,7 @@ bulkstat1_f(opnum_t opno, long r) + int fd; + int good; + __u64 ino; +- struct stat64 s; ++ struct stat s; + struct xfs_bstat t; + int v; + struct xfs_fsop_bulkreq bsr; +@@ -2534,7 +2534,7 @@ bulkstat1_f(opnum_t opno, long r) + init_pathname(&f); + if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) + append_pathname(&f, "."); +- ino = stat64_path(&f, &s) < 0 ? (ino64_t)r : s.st_ino; ++ ino = stat_path(&f, &s) < 0 ? (ino64_t)r : s.st_ino; + check_cwd(); + free_pathname(&f); + } else { +@@ -2605,8 +2605,8 @@ clonerange_f( + struct file_clone_range fcr; + struct pathname fpath1; + struct pathname fpath2; +- struct stat64 stat1; +- struct stat64 stat2; ++ struct stat stat1; ++ struct stat stat2; + char inoinfo1[1024]; + char inoinfo2[1024]; + off64_t lr; +@@ -2660,17 +2660,17 @@ clonerange_f( + } + + /* Get file stats */ +- if (fstat64(fd1, &stat1) < 0) { ++ if (fstat(fd1, &stat1) < 0) { + if (v1) +- printf("%d/%lld: clonerange read - fstat64 %s failed %d\n", ++ printf("%d/%lld: clonerange read - fstat %s failed %d\n", + procid, opno, fpath1.path, errno); + goto out_fd2; + } + inode_info(inoinfo1, sizeof(inoinfo1), &stat1, v1); + +- if (fstat64(fd2, &stat2) < 0) { ++ if (fstat(fd2, &stat2) < 0) { + if (v2) +- printf("%d/%lld: clonerange write - fstat64 %s failed %d\n", ++ printf("%d/%lld: clonerange write - fstat %s failed %d\n", + procid, opno, fpath2.path, errno); + goto out_fd2; + } +@@ -2743,8 +2743,8 @@ copyrange_f( + #ifdef HAVE_COPY_FILE_RANGE + struct pathname fpath1; + struct pathname fpath2; +- struct stat64 stat1; +- struct stat64 stat2; ++ struct stat stat1; ++ struct stat stat2; + char inoinfo1[1024]; + char inoinfo2[1024]; + loff_t lr; +@@ -2802,17 +2802,17 @@ copyrange_f( + } + + /* Get file stats */ +- if (fstat64(fd1, &stat1) < 0) { ++ if (fstat(fd1, &stat1) < 0) { + if (v1) +- printf("%d/%lld: copyrange read - fstat64 %s failed %d\n", ++ printf("%d/%lld: copyrange read - fstat %s failed %d\n", + procid, opno, fpath1.path, errno); + goto out_fd2; + } + inode_info(inoinfo1, sizeof(inoinfo1), &stat1, v1); + +- if (fstat64(fd2, &stat2) < 0) { ++ if (fstat(fd2, &stat2) < 0) { + if (v2) +- printf("%d/%lld: copyrange write - fstat64 %s failed %d\n", ++ printf("%d/%lld: copyrange write - fstat %s failed %d\n", + procid, opno, fpath2.path, errno); + goto out_fd2; + } +@@ -2900,7 +2900,7 @@ deduperange_f( + #define INFO_SZ 1024 + struct file_dedupe_range *fdr; + struct pathname *fpath; +- struct stat64 *stat; ++ struct stat *stat; + char *info; + off64_t *off; + int *v; +@@ -2938,7 +2938,7 @@ deduperange_f( + goto out_fdr; + } + +- stat = calloc(nr, sizeof(struct stat64)); ++ stat = calloc(nr, sizeof(struct stat)); + if (!stat) { + printf("%d/%lld: line %d error %d\n", + procid, opno, __LINE__, errno); +@@ -3017,9 +3017,9 @@ deduperange_f( + } + + /* Get file stats */ +- if (fstat64(fd[0], &stat[0]) < 0) { ++ if (fstat(fd[0], &stat[0]) < 0) { + if (v[0]) +- printf("%d/%lld: deduperange read - fstat64 %s failed %d\n", ++ printf("%d/%lld: deduperange read - fstat %s failed %d\n", + procid, opno, fpath[0].path, errno); + goto out_fds; + } +@@ -3027,9 +3027,9 @@ deduperange_f( + inode_info(&info[0], INFO_SZ, &stat[0], v[0]); + + for (i = 1; i < nr; i++) { +- if (fstat64(fd[i], &stat[i]) < 0) { ++ if (fstat(fd[i], &stat[i]) < 0) { + if (v[i]) +- printf("%d/%lld: deduperange write - fstat64 %s failed %d\n", ++ printf("%d/%lld: deduperange write - fstat %s failed %d\n", + procid, opno, fpath[i].path, errno); + goto out_fds; + } +@@ -3179,8 +3179,8 @@ splice_f(opnum_t opno, long r) + { + struct pathname fpath1; + struct pathname fpath2; +- struct stat64 stat1; +- struct stat64 stat2; ++ struct stat stat1; ++ struct stat stat2; + char inoinfo1[1024]; + char inoinfo2[1024]; + loff_t lr; +@@ -3237,17 +3237,17 @@ splice_f(opnum_t opno, long r) + } + + /* Get file stats */ +- if (fstat64(fd1, &stat1) < 0) { ++ if (fstat(fd1, &stat1) < 0) { + if (v1) +- printf("%d/%lld: splice read - fstat64 %s failed %d\n", ++ printf("%d/%lld: splice read - fstat %s failed %d\n", + procid, opno, fpath1.path, errno); + goto out_fd2; + } + inode_info(inoinfo1, sizeof(inoinfo1), &stat1, v1); + +- if (fstat64(fd2, &stat2) < 0) { ++ if (fstat(fd2, &stat2) < 0) { + if (v2) +- printf("%d/%lld: splice write - fstat64 %s failed %d\n", ++ printf("%d/%lld: splice write - fstat %s failed %d\n", + procid, opno, fpath2.path, errno); + goto out_fd2; + } +@@ -3432,7 +3432,7 @@ dread_f(opnum_t opno, long r) + size_t len; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + char *dio_env; +@@ -3454,9 +3454,9 @@ dread_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: dread - fstat64 %s failed %d\n", ++ printf("%d/%lld: dread - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -3522,7 +3522,7 @@ dwrite_f(opnum_t opno, long r) + size_t len; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + char *dio_env; +@@ -3544,9 +3544,9 @@ dwrite_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: dwrite - fstat64 %s failed %d\n", ++ printf("%d/%lld: dwrite - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -3620,7 +3620,7 @@ do_fallocate(opnum_t opno, long r, int m + int64_t lr; + off64_t off; + off64_t len; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + +@@ -3640,9 +3640,9 @@ do_fallocate(opnum_t opno, long r, int m + return; + } + check_cwd(); +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: do_fallocate - fstat64 %s failed %d\n", ++ printf("%d/%lld: do_fallocate - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -3734,7 +3734,7 @@ fiemap_f(opnum_t opno, long r) + int fd; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + int blocks_to_map; +@@ -3757,9 +3757,9 @@ fiemap_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: fiemap - fstat64 %s failed %d\n", ++ printf("%d/%lld: fiemap - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -3807,7 +3807,7 @@ freesp_f(opnum_t opno, long r) + struct xfs_flock64 fl; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + +@@ -3828,9 +3828,9 @@ freesp_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: freesp - fstat64 %s failed %d\n", ++ printf("%d/%lld: freesp - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -4226,7 +4226,7 @@ do_mmap(opnum_t opno, long r, int prot) + int64_t lr; + off64_t off; + int flags; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + sigjmp_buf sigbus_jmpbuf; +@@ -4248,9 +4248,9 @@ do_mmap(opnum_t opno, long r, int prot) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: do_mmap - fstat64 %s failed %d\n", ++ printf("%d/%lld: do_mmap - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -4370,7 +4370,7 @@ read_f(opnum_t opno, long r) + size_t len; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + +@@ -4391,9 +4391,9 @@ read_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: read - fstat64 %s failed %d\n", ++ printf("%d/%lld: read - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -4454,7 +4454,7 @@ readv_f(opnum_t opno, long r) + size_t len; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + struct iovec *iov = NULL; +@@ -4480,9 +4480,9 @@ readv_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: readv - fstat64 %s failed %d\n", ++ printf("%d/%lld: readv - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -4739,7 +4739,7 @@ resvsp_f(opnum_t opno, long r) + struct xfs_flock64 fl; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + +@@ -4760,9 +4760,9 @@ resvsp_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: resvsp - fstat64 %s failed %d\n", ++ printf("%d/%lld: resvsp - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -4971,7 +4971,7 @@ stat_f(opnum_t opno, long r) + { + int e; + pathname_t f; +- struct stat64 stb; ++ struct stat stb; + int v; + + init_pathname(&f); +@@ -4981,7 +4981,7 @@ stat_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- e = lstat64_path(&f, &stb) < 0 ? errno : 0; ++ e = lstat_path(&f, &stb) < 0 ? errno : 0; + check_cwd(); + if (v) + printf("%d/%lld: stat %s %d\n", procid, opno, f.path, e); +@@ -5133,7 +5133,7 @@ truncate_f(opnum_t opno, long r) + pathname_t f; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + +@@ -5144,11 +5144,11 @@ truncate_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- e = stat64_path(&f, &stb) < 0 ? errno : 0; ++ e = stat_path(&f, &stb) < 0 ? errno : 0; + check_cwd(); + if (e > 0) { + if (v) +- printf("%d/%lld: truncate - stat64 %s failed %d\n", ++ printf("%d/%lld: truncate - stat %s failed %d\n", + procid, opno, f.path, e); + free_pathname(&f); + return; +@@ -5157,7 +5157,7 @@ truncate_f(opnum_t opno, long r) + lr = ((int64_t)random() << 32) + random(); + off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); + off %= maxfsize; +- e = truncate64_path(&f, off) < 0 ? errno : 0; ++ e = truncate_path(&f, off) < 0 ? errno : 0; + check_cwd(); + if (v) + printf("%d/%lld: truncate %s%s %lld %d\n", procid, opno, f.path, +@@ -5209,7 +5209,7 @@ unresvsp_f(opnum_t opno, long r) + struct xfs_flock64 fl; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + +@@ -5230,9 +5230,9 @@ unresvsp_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: unresvsp - fstat64 %s failed %d\n", ++ printf("%d/%lld: unresvsp - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -5281,7 +5281,7 @@ write_f(opnum_t opno, long r) + size_t len; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + +@@ -5302,9 +5302,9 @@ write_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: write - fstat64 %s failed %d\n", ++ printf("%d/%lld: write - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +@@ -5337,7 +5337,7 @@ writev_f(opnum_t opno, long r) + size_t len; + int64_t lr; + off64_t off; +- struct stat64 stb; ++ struct stat stb; + int v; + char st[1024]; + struct iovec *iov = NULL; +@@ -5363,9 +5363,9 @@ writev_f(opnum_t opno, long r) + free_pathname(&f); + return; + } +- if (fstat64(fd, &stb) < 0) { ++ if (fstat(fd, &stb) < 0) { + if (v) +- printf("%d/%lld: writev - fstat64 %s failed %d\n", ++ printf("%d/%lld: writev - fstat %s failed %d\n", + procid, opno, f.path, errno); + free_pathname(&f); + close(fd); +--- a/tests/fssum.c ++++ b/tests/fssum.c +@@ -519,9 +519,9 @@ sum(int dirfd, int level, sum_t *dircs, + int excl; + sum_file_data_t sum_file_data = flags[FLAG_STRUCTURE] ? + sum_file_data_strict : sum_file_data_permissive; +- struct stat64 dir_st; ++ struct stat dir_st; + +- if (fstat64(dirfd, &dir_st)) { ++ if (fstat(dirfd, &dir_st)) { + perror("fstat"); + exit(-1); + } +@@ -552,7 +552,7 @@ sum(int dirfd, int level, sum_t *dircs, + } + qsort(namelist, entries, sizeof(*namelist), namecmp); + for (i = 0; i < entries; ++i) { +- struct stat64 st; ++ struct stat st; + sum_t cs; + sum_t meta; + char *path; +@@ -572,7 +572,7 @@ sum(int dirfd, int level, sum_t *dircs, + perror("fchdir"); + exit(-1); + } +- ret = lstat64(namelist[i], &st); ++ ret = lstat(namelist[i], &st); + if (ret) { + fprintf(stderr, "stat failed for %s/%s: %m\n", + path_prefix, path); diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.0.2.bb b/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.0.2.bb index 872fba6b6d..aa48422080 100644 --- a/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.0.2.bb +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.0.2.bb @@ -17,6 +17,7 @@ DEPENDS = "util-linux zlib" SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git;branch=master \ file://0001-Add-a-possibility-to-specify-where-python-modules-ar.patch \ + file://0001-Use-pread-pwrite-ftruncate-stat-instead-of-64bit-equ.patch \ " SRCREV = "ff964ba6aef98bd1bafe8ff9b0088501b30bdd27" S = "${WORKDIR}/git"