Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3023457ybc; Thu, 21 Nov 2019 02:05:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyxOlwJhMCOu8gbJwPXjdb/a/w53OyAYFTExikyurxd7PnwCqwmwVyOU+2AF4B8FOtolAym X-Received: by 2002:a17:906:8606:: with SMTP id o6mr13192274ejx.202.1574330724073; Thu, 21 Nov 2019 02:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574330724; cv=none; d=google.com; s=arc-20160816; b=F9mN2eEQdzT9LTjtrT8mp9bya0+1LOipAykiqXlR9aoIpoznbJfUrbB5B690Yn9MA6 vdZ8lUOYmuPRBgwNbjdX8kfJMmNFwSxVzDZdga85eUFEpx86LrX5lqq9ih6zrop0u4+N A8f6bFKj8JuIF4Fkl2hVbyONRjUk6QM4I4/EdOYiMiKAV/jNp+qzJrbEj9JG5RFJFJsI iob4w9Ug6fdzsxeTfL8iJXdVZCw2icEBPwm47SOBTqp36QGazciOa2oeGY9VXYmIB+6F XhjJV1eNzrfoxvzszLTfDXHitKfLBpgRFzJoSVo9S8I6d0MjHVVmGstO0DHl8ulGbvux +7VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=azm6258Y/h1Yi1v25/cgX4nZQFn/wXyDk4OUzPAogIw=; b=rLp21xncfjpmlL+JBT4t9DeGaP7pAGhYTwqTF9EwJy4VgQkHx6S0kYMoZSIxlOygku 8njmCPvNa9OYowunQh/iBxkD+2JiM+o+OtD1D8zz6LlLT4iW1P0ICZRbeld8mVu40rAQ Eb7rhTv5n3Vz3ji9sAjh8HDKArVBshalEI+DKL7PTVhu9l6JWDgwXVIbzVKJEe/rbYho K72sKPO5ZYNIB+bgpt/QVuuDz6Jw2oBE2FEZBSh9wvFBgB+SVc5r3ykv4HxOkWEFkcYO ZM+SYrpkW68Ov5S0yHbk3znL19OpQ0QW7LvVl4LOxHps5vyGV5EArlCZmQuF5yywsGzC nhzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=VIxmx3lB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si2266292edt.143.2019.11.21.02.05.00; Thu, 21 Nov 2019 02:05:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=VIxmx3lB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727004AbfKUKDe (ORCPT + 99 others); Thu, 21 Nov 2019 05:03:34 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:37635 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbfKUKDa (ORCPT ); Thu, 21 Nov 2019 05:03:30 -0500 Received: by mail-io1-f67.google.com with SMTP id 1so2722829iou.4 for ; Thu, 21 Nov 2019 02:03:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=azm6258Y/h1Yi1v25/cgX4nZQFn/wXyDk4OUzPAogIw=; b=VIxmx3lBXUc/OsjeFNHkalvySAflAWkvsgeR9sJSmDV3UMExPqRNneJibNAVZx0ORP TNOoZyXyQ0AHvM5PmbjOyt50zoipblJXoCN9Cp925i1ScOTrpzzHGB9QnW8rvvZR9eVN ogW18j8FBdeFL19T3L64w40J70OFSxaWsJUuc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=azm6258Y/h1Yi1v25/cgX4nZQFn/wXyDk4OUzPAogIw=; b=I2hyJQ9soGvvpn27in4gtFDpubCtVk3P66MdA3xvvkymBKduBD6YFnL+eVkJqxa/eJ pODhK/wtJ1vkrmTUuUorYjdySFz2msVMlK1lGuMlyFTlBLlKbslKni8E21F49158hGel enzSasCLKb2DIITboIqE5Xjp6DGBZGlTZOqPrB9oMNy5HcbzQEWkuEsuf+xxPbrRtxaf PMWz3fI2Y50T4bd3yAh5Ny0HZ9varZSppifdWkiuU50TfF5sLmhbW5Q0JW8AyKFuUXOk XcRAw4fPUkWNotWqi6kzqrnGdLr29Nyr3P3H/dvGCW7VL4YCag01GYOLjLTS9cp/K93H W6bQ== X-Gm-Message-State: APjAAAXtVTO8Ot5CoLZJove4sjIJuA9lzz8uAmWd4DI/KX1tPsxqmvyu mJL5wxO4GNA5nozXcgWt6DTdOCPEWvqSJU6HOqDaZw== X-Received: by 2002:a02:c05a:: with SMTP id u26mr8022037jam.58.1574330609772; Thu, 21 Nov 2019 02:03:29 -0800 (PST) MIME-Version: 1.0 References: <20191121070613.4286-1-hu1.chen@intel.com> In-Reply-To: <20191121070613.4286-1-hu1.chen@intel.com> From: Miklos Szeredi Date: Thu, 21 Nov 2019 11:03:18 +0100 Message-ID: Subject: Re: [PATCH] proc: align mnt_id in /proc/pid/fdinfo and /proc/pid/mountinfo To: "Chen, Hu" Cc: Andrey Vagin , Alexander Viro , Alexey Dobriyan , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 8:28 AM Chen, Hu wrote: > > For Android application process, we found that the mnt_id read from > /proc/pid/fdinfo doesn't exist in /proc/pid/mountinfo. Thus CRIU fails > to dump such process and it complains > > "(00.019206) Error (criu/files-reg.c:1299): Can't lookup mount=42 for > fd=-3 path=/data/dalvik-cache/x86_64/system@framework@boot.art" > > This is due to how Android application is launched. In Android, there is > a special process called Zygote which handles the forking of each new > application process: > 0. Zygote opens and maps some files, for example > "/data/dalvik-cache/x86_64/system@framework@boot.art" in its current > mount namespace, say "old mnt ns". > 1. Zygote waits for the request to fork a new application. > 2. Zygote gets a request, it forks and run the new process in a new > mount namespace, say "new mnt ns". > > The file opened in step 0 ties to the mount point in "old mnt ns". The > mnt_id of that mount is listed in /proc/pid/fdinfo. However, > /proc/pid/mountinfo points to current ns, i.e., "new mnt ns". > > Althgouh this issue is exposed in Android, we believe it's generic. > Prcoess may open files and enter new mnt ns. > > To address it, this patch searches the mirror mount in current ns with > MAJOR and MINOR and shows the mirror's mnt_id. This is a hack. I suggest instead to add a new line to fdinfo with the MAJOR:MINOR number of the device. Thanks, Miklos