From patchwork Fri Oct 2 17:06:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 40644 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7DCD9386F441; Fri, 2 Oct 2020 17:06:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7DCD9386F441 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1601658389; bh=nwq2KNgfk2BoH2PuaVxQ+20gcBIfo966RV+s+f0Ftxs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=bv7spYKBCYAWc1UgNslpCan/KTBnRkOkg51oWucHllHcvMuia+l2WUsi67Vm/jTWM 0beYqgocSoiSSYJEH7MtQ5mQ6/jFP1BgDfIbclVbQya5CTrAvSInC0m++vNYGvUA3t b1LFqZj+0PRQyCrbPIPa+3V1xOrtOTwKbBTrbbkQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by sourceware.org (Postfix) with ESMTPS id BF5BE3857C49 for ; Fri, 2 Oct 2020 17:06:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BF5BE3857C49 Received: by mail-qt1-x841.google.com with SMTP id 19so1847286qtp.1 for ; Fri, 02 Oct 2020 10:06:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nwq2KNgfk2BoH2PuaVxQ+20gcBIfo966RV+s+f0Ftxs=; b=be7ggHGRb/z1Pk+IJdfHbBy0Ld15XiIjpKmuBocmzjT44CREpzortLdVO02ky6kiTb 4cEb+B07IMjhtJ54LGjwHg1fQ6n5Drm/Gl5vX1uwmuKQinjp+Fa4Bas/hOcPm3Rj1Q6/ iSiuT6fWfL3O1W1SMIxyIAO4bo4c6clx+y3bj7JzU0MdBb4iBqaX56jQkZV2pohn36uh xc/ZnZ/0bAuhB/1Q5rjdJyKJjVNgDCniu07zrwZ9+WYIG3iDN8TAfm6QhuyUqhhwRpFv SdbqptM295F3+vYX8+HhPbWZ5RvDjCq1T9LAR+OD3wyoAxWvue6+4gFNU8ztY519CEFZ 4SHA== X-Gm-Message-State: AOAM532jxqQ+GTV9Eob0TREHb7qfG4qRjCI5d4sHI/rvAVs3vbaJ9hbk IgywXVKhwnCERj59bjoBZa8WKYez7hnTew== X-Google-Smtp-Source: ABdhPJyLAjus+tKg3wsyb4jz+uTKLUR/JQ4d2z+LK3pycOAq8QmyABaoMsjDDYwqF64juWZLo8IYow== X-Received: by 2002:ac8:47cf:: with SMTP id d15mr3260503qtr.197.1601658386115; Fri, 02 Oct 2020 10:06:26 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id d10sm1436891qkk.1.2020.10.02.10.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 10:06:25 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 0/9] Fix getdents{64} regression on some FS Date: Fri, 2 Oct 2020 14:06:11 -0300 Message-Id: <20201002170620.1611673-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: James Clarke , John Paul Adrian Glaubitz Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This is updated version [1], rebased against master add with some suggestion from previous review. I am re-sending because BZ #23960 report keep being updated with users that see the BZ #23960 issue in different scenarios. I have reports from both Debian and Gentoo developers that this patchset fixes the issues they saw with recent glibc on some scenarios (schroot plus qemu) and on some filesystem (ext4). They can correct me with their testing status. [1] https://sourceware.org/pipermail/libc-alpha/2020-April/112866.html Adhemerval Zanella (9): linux: Move posix dir implementations to Linux linux: Simplify opendir buffer allocation linux: Add __readdir_unlocked linux: Use getdents64 on non-LFS readdir linux: Set internal DIR filepos as off64_t [BZ #23960, BZ #24050] linux: Add __readdir64_unlocked linux: Add __old_readdir64_unlocked linux: Use getdents64 on readdir64 compat implementation dirent: Deprecate getdirentries NEWS | 3 + dirent/Makefile | 2 +- dirent/dirent.h | 11 +- dirent/tst-seekdir2.c | 156 +++++++++++++++++ include/dirent.h | 5 +- support/temp_file.c | 12 +- support/temp_file.h | 7 + sysdeps/posix/readdir.c | 127 -------------- sysdeps/posix/readdir_r.c | 159 ------------------ sysdeps/posix/telldir.c | 33 ---- sysdeps/unix/sysv/linux/Makefile | 3 + sysdeps/{posix => unix/sysv/linux}/closedir.c | 4 + sysdeps/{posix => unix/sysv/linux}/dirfd.c | 0 .../{posix => unix/sysv/linux}/dirstream.h | 7 +- .../{posix => unix/sysv/linux}/fdopendir.c | 0 sysdeps/unix/sysv/linux/getdents64.c | 95 +---------- sysdeps/unix/sysv/linux/olddirent.h | 4 +- sysdeps/{posix => unix/sysv/linux}/opendir.c | 56 +++--- sysdeps/unix/sysv/linux/readdir.c | 69 +++++++- sysdeps/unix/sysv/linux/readdir.h | 159 ++++++++++++++++++ sysdeps/unix/sysv/linux/readdir64.c | 149 ++++++++++++++-- sysdeps/unix/sysv/linux/readdir64_r.c | 103 ++++++++++-- sysdeps/unix/sysv/linux/readdir_r.c | 50 +++++- .../{posix => unix/sysv/linux}/rewinddir.c | 5 + sysdeps/{posix => unix/sysv/linux}/seekdir.c | 36 +++- sysdeps/unix/sysv/linux/telldir.c | 76 +++++++++ sysdeps/unix/sysv/linux/telldir.h | 64 +++++++ 27 files changed, 907 insertions(+), 488 deletions(-) create mode 100644 dirent/tst-seekdir2.c delete mode 100644 sysdeps/posix/readdir.c delete mode 100644 sysdeps/posix/readdir_r.c delete mode 100644 sysdeps/posix/telldir.c rename sysdeps/{posix => unix/sysv/linux}/closedir.c (95%) rename sysdeps/{posix => unix/sysv/linux}/dirfd.c (100%) rename sysdeps/{posix => unix/sysv/linux}/dirstream.h (93%) rename sysdeps/{posix => unix/sysv/linux}/fdopendir.c (100%) rename sysdeps/{posix => unix/sysv/linux}/opendir.c (74%) create mode 100644 sysdeps/unix/sysv/linux/readdir.h rename sysdeps/{posix => unix/sysv/linux}/rewinddir.c (95%) rename sysdeps/{posix => unix/sysv/linux}/seekdir.c (65%) create mode 100644 sysdeps/unix/sysv/linux/telldir.c create mode 100644 sysdeps/unix/sysv/linux/telldir.h