Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1340224pxm; Sat, 26 Feb 2022 12:17:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2yFTDa8CMuN2jqsB1+vg3ZAIwluj2s4asEwjTrQucM8juq7jm/k9D7cBS6ZiZ9x61M29Y X-Received: by 2002:a17:903:1209:b0:14e:e31c:b8c4 with SMTP id l9-20020a170903120900b0014ee31cb8c4mr13929659plh.153.1645906648289; Sat, 26 Feb 2022 12:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645906648; cv=none; d=google.com; s=arc-20160816; b=qF259LOh6kPz9oBctDGvvI04hbRURHKJ/tp61VJywFPmMFsIV4zgqIBQjWXf3aqx5y nab2LvmENzoa1251qY/b4LGNQhbDv+6VpTOwhpDmgAqAP4reiCvP1GHnVDff0NdgBCw+ gI5wtdJs4L0gRZ2KNDJpV3pYyLMh4z8yuWYPv2dAWCuvJqr6oVVKVpuCH+sufZGCDWRe w3LIHcQh0x4izUTQ2GBSEfTpqX1lP01LXwdp9FqnELiE+gSAnUXJBRiLhL1hzf8Wxeoj 9Ht3n39PKOyIRECyzlacOZH7w3LWa8vDB/5Hb0u1YlKnjwSWevuOj5CRE7cB0yGSdkoE ToSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:from:subject:cc:to:message-id :date:dkim-signature; bh=sautZp78bp1zZn5HE5LQAe/g0BTsOX/w5SupO4dw9Bw=; b=zRtp/spOS2hhmxKdScI9/QiOL8wIDbt+0nB5rXsPkUOOEodlZB4xRIVvBqImjSWm9a p1SQwU89dyYW8ibARNsAu2HT7D8oZM7Tpb2qePZBe/qRX0vL4ZCj7LlkBPLNQhqhoLq7 fq4e/gYl5ZdryHQ20pG00BlEkJK+VjLpkAb1G75Wp9U7Ie6BKWLs9oKpzGzYZez7oZAV E0OYtU/dZb0Ph8Urfh2heB76AV4dPLZg+hEt+7usYFsLq8799LyGV8yCefV3dHU/yggK +SOhEhdSu7Odk21YQmZUxsA2FV+SGdV65gjera1I6U6inJJpzaZE1e9bqH6iebNG0DK9 XPdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CJ0ZmTCi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u8-20020a634708000000b00374844c777asi5419982pga.299.2022.02.26.12.17.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 12:17:28 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CJ0ZmTCi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7474829C3EA; Sat, 26 Feb 2022 12:11:18 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232148AbiBZT1z (ORCPT + 99 others); Sat, 26 Feb 2022 14:27:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230501AbiBZT1y (ORCPT ); Sat, 26 Feb 2022 14:27:54 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4193FD5F56 for ; Sat, 26 Feb 2022 11:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645903638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sautZp78bp1zZn5HE5LQAe/g0BTsOX/w5SupO4dw9Bw=; b=CJ0ZmTCiI1V+kcOCYYNrR3wkOTWG3Opyaja2rZlxnjjUXtLv3TBziwi8DsZ7STj+VBCy8O 7yKOHNvKPH34hSx0umdkRzhIF0aIYONnY7Us6zh/jBi9WAlMOWSWe/FhjUj50PYr64tzeb gQ1euXOTYmnsTXUIFYdY9/+Yzi+2AUI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-oi5vl-Q1Nru1O3uUm9oL6w-1; Sat, 26 Feb 2022 14:27:15 -0500 X-MC-Unique: oi5vl-Q1Nru1O3uUm9oL6w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB0EB8145F6; Sat, 26 Feb 2022 19:27:13 +0000 (UTC) Received: from localhost (unknown [10.64.242.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9737641BE; Sat, 26 Feb 2022 19:27:08 +0000 (UTC) Date: Sun, 27 Feb 2022 04:27:07 +0900 (JST) Message-Id: <20220227.042707.2131548399286487704.yamato@redhat.com> To: zeha@debian.org Cc: matorola@gmail.com, kzak@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, util-linux@vger.kernel.org Subject: Re: [ANNOUNCE] util-linux v2.38-rc1 From: Masatake YAMATO In-Reply-To: <20220206164734.cgdrkcuvwzy76pyy@zeha.at> References: <20220202.232106.1642450897216370276.yamato@redhat.com> <20220205.030324.1280110384368183671.yamato@redhat.com> <20220206164734.cgdrkcuvwzy76pyy@zeha.at> Organization: Red Hat Japan, Inc. Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for being late. > Hello Masatake YAMATO, > > Thank you for the followup. > > * Masatake YAMATO [220204 19:03]: >> > Could you tell me what kind of file system for /etc/passwd do you use for testing? > > sbuild/schroot can use different mechanisms, but in this case / is > overlayfs (the underlying fs is ext4): > unstable-amd64-sbuild on / type overlay (rw,relatime,...) > > ls -la /etc/passwd > -rw-r--r-- 1 root root 2397 Feb 6 16:41 /etc/passwd > stat /etc/passwd > File: /etc/passwd > Size: 2397 Blocks: 8 IO Block: 4096 regular file > Device: 33h/51d Inode: 1311528 Links: 1 > Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) > Access: 2022-02-06 16:41:26.880589326 +0000 > Modify: 2022-02-06 16:41:26.720591039 +0000 > Change: 2022-02-06 16:41:26.720591039 +0000 > Birth: - > mount Thank you. I found this one was a critical hint for fixing. The failure reports a bug of the test case, not a bug of lsfd command. I made a new pull request for this bug: https://github.com/util-linux/util-linux/pull/1611. Quoted from the pull request: The original test cases depended on a wrong assumption; if M and M' are the same, D and D' are the same, too. Here, M is a mnt_id in /proc/$pid/mountinfo. D is the device number for M in /proc/$pid/mountinfo. M' is the mnt_id value in /proc/$pid/fdinfo/$fd. D' is the device number reported by stat syscall for /proc/$pid/fd/$fd. # ../../lsfd -oCOMMAND,PID,MNTID,DEV,NAME -p 2972623 -Q '(ASSOC =~ "^[0-9]+$") and (TYPE == "REG")' COMMAND PID MNTID DEV NAME a.out 2972623 1578 0:98 /home/jet/var/util-linux/o/merged/y # stat -c %d /home/jet/var/util-linux/o/merged/y 98 # grep 1578 /proc/2972623/mountinfo 1578 91 0:91 / /home/jet/var/util-linux/o/merged rw,relatime shared:724 - overlay overlay rw,seclabel,lowerdir=lower-base/lower,upperdir=upper-base/upper,workdir=upper-base/work The original test compared the device numbers reported by findmnt and lsfd. findmnt retrieves a device number from /proc/$pid/mountinfo. lsfd retrieves a device number from stat syscall. This assumption is not correct for a file on an overlay file system whose block devices behind lowerdir and upperdir are different. Using findmnt is not suitable for comparing device numbers. I expect the bug is fixed with the pull request. Masatake YAMATO >> As I commented on GitHub, I made a pull request for fixing this issue. >> I found a bug in the test case, not in lsfd itself. >> >> https://github.com/util-linux/util-linux/pull/1595 >> https://github.com/util-linux/util-linux/pull/1595/commits/abd93fcecfbb1a1fac7032fac9d2903c5d2d3a38 >> >> > When trying to reproduce the bug, could you applying the following change? > > I have applied abd93fcecfbb1a1fac7032fac9d2903c5d2d3a38 alone, which > does not help in my case (DEV[STR] is 0 instead of 1). > > I have also applied #1595 in full in a second build, see output > below. > > Many thanks, > Chris > > > > script: /<>/tests/ts/lsfd/mkfds-ro-regular-file > commands: /<>/ > helpers: /<>/ > sub dir: /<>/tests/ts/lsfd > top dir: /<>/tests > self: /<>/tests/ts/lsfd > test name: mkfds-ro-regular-file > test desc: read-only regular file > component: lsfd > namespace: lsfd/mkfds-ro-regular-file > verbose: yes > output: /<>/tests/output/lsfd/mkfds-ro-regular-file > error log: /<>/tests/output/lsfd/mkfds-ro-regular-file.err > exit code: /<>/tests/output/lsfd/mkfds-ro-regular-file.exit_code > valgrind: /<>/tests/output/lsfd/mkfds-ro-regular-file.vgdump > expected: /<>/tests/expected/lsfd/mkfds-ro-regular-file{.err} > mountpoint: /<>/tests/output/lsfd/mkfds-ro-regular-file-mnt > > lsfd: read-only regular file ... FAILED (lsfd/mkfds-ro-regular-file) > ========= script: /<>/tests/ts/lsfd/mkfds-ro-regular-file ================= > ================= OUTPUT ===================== > 1 ABC 3 r-- REG /etc/passwd 1 > 2 COMMAND,ASSOC,MODE,TYPE,NAME,POS: 0 > 3 PID[RUN]: 0 > 4 PID[STR]: 0 > 5 INODE[RUN]: 0 > 6 INODE[STR]: 0 > 7 UID[RUN]: 0 > 8 UID[STR]: 0 > 9 USER[RUN]: 0 > 10 USER[STR]: 0 > 11 SIZE[RUN]: 0 > 12 SIZE[STR]: 0 > 13 MNTID[RUN]: 0 > 14 DEV[RUN]: 0 > 15 FINDMNT[RUN]: 0 > 16 DEV[STR]: 1 > 17 MNTID: 312 > 18 DEV: 0:50 > 19 MNTID DEV: 312 0:50 > 20 FINDMNT_MNTID_DEV: 312 0:48 > ================= EXPECTED =================== > 1 ABC 3 r-- REG /etc/passwd 1 > 2 COMMAND,ASSOC,MODE,TYPE,NAME,POS: 0 > 3 PID[RUN]: 0 > 4 PID[STR]: 0 > 5 INODE[RUN]: 0 > 6 INODE[STR]: 0 > 7 UID[RUN]: 0 > 8 UID[STR]: 0 > 9 USER[RUN]: 0 > 10 USER[STR]: 0 > 11 SIZE[RUN]: 0 > 12 SIZE[STR]: 0 > 13 MNTID[RUN]: 0 > 14 DEV[RUN]: 0 > 15 FINDMNT[RUN]: 0 > 16 DEV[STR]: 0 > ================= O/E diff =================== > --- /<>/tests/output/lsfd/mkfds-ro-regular-file 2022-02-06 16:37:28.111146267 +0000 > +++ /<>/tests/expected/lsfd/mkfds-ro-regular-file 2022-01-31 14:57:47.000000000 +0000 > @@ -13,8 +13,4 @@ > MNTID[RUN]: 0 > DEV[RUN]: 0 > FINDMNT[RUN]: 0 > -DEV[STR]: 1 > -MNTID: 312 > -DEV: 0:50 > -MNTID DEV: 312 0:50 > -FINDMNT_MNTID_DEV: 312 0:48 > +DEV[STR]: 0 > ============================================== > > script: /<>/tests/ts/lsfd/mkfds-rw-character-device > commands: /<>/ > helpers: /<>/ > sub dir: /<>/tests/ts/lsfd > top dir: /<>/tests > self: /<>/tests/ts/lsfd > test name: mkfds-rw-character-device > test desc: character device with O_RDWR > component: lsfd > namespace: lsfd/mkfds-rw-character-device > verbose: yes > output: /<>/tests/output/lsfd/mkfds-rw-character-device > error log: /<>/tests/output/lsfd/mkfds-rw-character-device.err > exit code: /<>/tests/output/lsfd/mkfds-rw-character-device.exit_code > valgrind: /<>/tests/output/lsfd/mkfds-rw-character-device.vgdump > expected: /<>/tests/expected/lsfd/mkfds-rw-character-device{.err} > mountpoint: /<>/tests/output/lsfd/mkfds-rw-character-device-mnt > > lsfd: character device with O_RDWR ... FAILED (lsfd/mkfds-rw-character-device) > ========= script: /<>/tests/ts/lsfd/mkfds-rw-character-device ================= > ================= OUTPUT ===================== > 1 3 rw- CHR /dev/zero mem:5 0 1:5 mem char 1:5 > 2 ASSOC,MODE,TYPE,NAME,SOURCE,POS,MAJ:MIN,CHRDRV,DEVTYPE,RDEV: 0 > 3 MNTID[RUN]: 0 > 4 DEV[RUN]: 0 > 5 FINDMNT[RUN]: 0 > 6 DEV[STR]: 1 > 7 MNTID: 312 > 8 DEV: 0:50 > 9 MNTID DEV: 312 0:50 > 10 FINDMNT_MNTID_DEV: 312 0:48 > ================= EXPECTED =================== > 1 3 rw- CHR /dev/zero mem:5 0 1:5 mem char 1:5 > 2 ASSOC,MODE,TYPE,NAME,SOURCE,POS,MAJ:MIN,CHRDRV,DEVTYPE,RDEV: 0 > 3 MNTID[RUN]: 0 > 4 DEV[RUN]: 0 > 5 FINDMNT[RUN]: 0 > 6 DEV[STR]: 0 > ================= O/E diff =================== > --- /<>/tests/output/lsfd/mkfds-rw-character-device 2022-02-06 16:37:28.675140230 +0000 > +++ /<>/tests/expected/lsfd/mkfds-rw-character-device 2022-01-31 14:57:47.000000000 +0000 > @@ -3,8 +3,4 @@ > MNTID[RUN]: 0 > DEV[RUN]: 0 > FINDMNT[RUN]: 0 > -DEV[STR]: 1 > -MNTID: 312 > -DEV: 0:50 > -MNTID DEV: 312 0:50 > -FINDMNT_MNTID_DEV: 312 0:48 > +DEV[STR]: 0 > ============================================== >