Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4876775rdb; Tue, 12 Dec 2023 11:46:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsui38MuOHv+1DGvRK62q/PUrW95jTbRLMXLG8pPy3Ox9+CEGzH54ZeByN8xfPLzOV+Z/l X-Received: by 2002:a05:6e02:1a67:b0:35d:5995:1d72 with SMTP id w7-20020a056e021a6700b0035d59951d72mr10994271ilv.55.1702410365652; Tue, 12 Dec 2023 11:46:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702410365; cv=none; d=google.com; s=arc-20160816; b=Hp6GdLW+CKs/W4Kk7M0DPvgsCRuwUgNTJ0is0bwlgsStHjUeZ3EZhQelT0HUju/Qmj u+ZmziVKRyN0ndAW+vgqGLsIemMeOD51iyUBZNOr/i58vfkKpOT/E07yjG/EAHiODVFP S7PaLGKnngdUSdR8qRfnLYqkT5NmJE/3Gziu2r7IF7avQqYlaJLOzzQnY4yRU0qz/Ow6 0KExURwRUf+AkQViAdslkA1MdZO/nGgn4/fgnz8t8nrudSLcNALPb497lv81rHr6t5eA LmPZnmOwuchj199PGb74Fj5zmnJcbs95F+KPbv8KOheT4dYpd62Vahv6/uni3irYwrAj 7I0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zqpE4b9HeVSGikGGqeFsJ4KywhPDheldl45r4Yspt1s=; fh=7mgI9X2q1dgko0i7jl6980ipqSt5+cNAaloVCIQ3LgM=; b=CCCcfxcxFhmHVJOBTVn+cEYZS7AdnoEQJE/oGme2fox++r9NsZmiq5sng44C1QialZ xoW20xKRYwevnK5PckNmH7dCQkw1nHZXiVQ0CK1vbWMg477RZYhD/hJ+BTtD6sEmBEfL TYS2xwZofER4jmiWSQ2MsMvLoh+56UAoWvHSiiGE4fMzTY/bX6gTqcTcL5/luCKXs/fW GbuHs7Tf+gVbPo/f4+/RXBg0reoHcbTsCPKJ38LPgexi4w/VYw4InW7dN37WzoLyL8iw 8mnkUBS4JTcXkcjnFxsH4sleqNgnr7e4fqL4U+1DNb+a8bUT2CarstOymz+d0fAqSUPq NrvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=i8u5UfXo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id i2-20020a654842000000b005c67029a131si8116197pgs.220.2023.12.12.11.46.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:46:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=i8u5UfXo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3795F80215AD; Tue, 12 Dec 2023 11:46:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377168AbjLLTpj (ORCPT + 99 others); Tue, 12 Dec 2023 14:45:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231609AbjLLTpi (ORCPT ); Tue, 12 Dec 2023 14:45:38 -0500 Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A05099A for ; Tue, 12 Dec 2023 11:45:44 -0800 (PST) Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-58dd3528497so3702458eaf.3 for ; Tue, 12 Dec 2023 11:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702410344; x=1703015144; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zqpE4b9HeVSGikGGqeFsJ4KywhPDheldl45r4Yspt1s=; b=i8u5UfXo6biNyk/8fSn10Oxe5R/rcnjAgsyRVUYzstlYtpCS8I+S7uoIP9CMXdy8o5 V13OxAj6Rw20YY9xDrZyqQwAAv5m1gVsIo7hTzvb/xTQalGmomSlYgw+Sn/vahtVOD46 tInz64T5bBEDxjU1TrCy4WlmggVVO1vnpK956z0296xz7Qpr9SKCHpFpYRGPLq9/rf45 suBn1TtXcCnn7LLBfv3yXVsWcjY5y0cbpX0qnq1Ig+rzTJKem32IwVmlDmoBNXXTn4iw Y4yqJNpZcagcVhr5F80TMxT3C3CIZJer9pv9sZdLXxJEyRDrzieSzQx10qZFPFVV7oVm fi1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702410344; x=1703015144; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zqpE4b9HeVSGikGGqeFsJ4KywhPDheldl45r4Yspt1s=; b=J8zCx/y7t636JnNJqFNCRK9c7sz7X3u9MncDDlI657EBwM3aKrAe23qTN2WY5gtv1t 5QoqikCgUSoT52FK2PgfLdSI/FOXyZ5kYTLD1Vg/uVSAg1BiHF8rIYSrcS9Kg26Mp8Zg NNTDw78W7GUCej7cmRvn4wxidHefQN/cmo/925Coxzga2dgXFU3wuISJtRIHLLEtBDeb YWEcTJB6ziiD1nzQTt61kjVkiEhYbr80jjNtHx7dOWGP7vv3wbuHXHs7StYmfu7ajLAA 4E+/FieievD67z+xsfE110i7pe6bZiEbB9EdHKQJQrjcKTrkwEjadhYL1dtc6K7+weDL +Eag== X-Gm-Message-State: AOJu0YwDE2UPvBss77qIt4nwQXEHrosX4vEU71EvFg8wNq/56K7/umlZ eGlE+6yGc1N4k5Rq9UzyHyvy+e+amGJlDwNMBXwnLg== X-Received: by 2002:a05:6820:826:b0:58d:713d:a003 with SMTP id bg38-20020a056820082600b0058d713da003mr5029156oob.3.1702410343848; Tue, 12 Dec 2023 11:45:43 -0800 (PST) MIME-Version: 1.0 References: <20231211193048.580691-1-avagin@google.com> <20231211193048.580691-2-avagin@google.com> In-Reply-To: <20231211193048.580691-2-avagin@google.com> From: Andrei Vagin Date: Tue, 12 Dec 2023 11:45:33 -0800 Message-ID: Subject: Re: [PATCH 2/2] selftests/overlayfs: verify device and inode numbers in /proc/pid/maps To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Amir Goldstein , Alexander Mikhalitsyn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Dec 2023 11:46:03 -0800 (PST) On Mon, Dec 11, 2023 at 11:30=E2=80=AFAM Andrei Vagin w= rote: > +static long get_file_dev_and_inode(void *addr, struct statx *stx) > +{ > + char buf[4096]; > + FILE *mapf; > + > + mapf =3D fopen("/proc/self/maps", "r"); > + if (mapf =3D=3D NULL) > + return pr_perror("fopen(/proc/self/maps)"); > + > + while (fgets(buf, sizeof(buf), mapf)) { > + unsigned long start, end; > + uint32_t maj, min; > + __u64 ino; > + > + if (sscanf(buf, "%lx-%lx %*s %*s %x:%x %llx", > + &start, &end, &maj, &min, &ino) !=3D 5) inode is shown in the decimal format, so the last %llx has to be replaced with %llu. I will resend this test in reply to Amir's version of the first patch. Thanks, Andrei