Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1764391imm; Thu, 9 Aug 2018 01:21:12 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxgKc8zJHXEtNrmIffISq7tww4jHZMzmmYRN1ti1MiOolLwAEJTTbM3PE3OTNhjfRS6wsaj X-Received: by 2002:a17:902:59da:: with SMTP id d26-v6mr1186002plj.42.1533802872286; Thu, 09 Aug 2018 01:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533802872; cv=none; d=google.com; s=arc-20160816; b=rWu3e/EnAKY6A4/FEZrXBzZcEuoAti64JqNs2nSRurxyttHb23suLajGKuv3Wm4GYQ GUtJd8fNEeLgz0tA+6T0RKX1+wX/mTZF/FhrBmAUJwsbeHdUAAQbUrAoBYfUchC7jh59 5PEk3gyYV60jxeHQC0jMJdhMVJG6Ee3AII9lmE4enf6vrKOPqw9lmDZxOqvkMMjkaoVs p9nBQ6SbFrP2MpvZKnQbwNhwj4n5x66oYTr91WgyXlkVmvoLjxTYDQxNp5duC915reLy nMfaCbZqtE57hfwr0WcpFZSUVKTx+3IGxGmhpdcbube5Z/ybGVshcFPVqOKTWcf1/imQ +iDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=7eysuHhm7NU/RDYqzaGe4KgJdI92HzEPh0GSlMFlIHg=; b=QzvKBjkGHyZGe2AEUpRBOGGhPFM2jXt63lP8eMPRUR0q4oqDOh1IRXMz2LcREOiaJd 7vkINPr7K+oHBFtBxU95OkMOtQFzq5D5sP6qhTryDdWFUtRc5g5fZsT7FznCYW0QWSab ig7Whlfyc0q1jDE0BD9ZTW/HPdzGuH1n1jsd5UYTnppfI+ZV+hUal864bGJEpoTuqbGv z8p6yXfCuFrECeuykLwtpdTUKY0yqNQQaiFwU5vquT0Q+3W3VoifLtEENjS28TAuW+O3 OYB40cpYCQfgfhOXvVd9G+iI4ORx9eInePlvHBO+Jjzq86HGS9nPl5zSelRPY/JcNjsB M7aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=evKlTM8x; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n38-v6si6275955pgb.536.2018.08.09.01.20.57; Thu, 09 Aug 2018 01:21:12 -0700 (PDT) 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=pass header.i=@virtuozzo.com header.s=selector1 header.b=evKlTM8x; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728582AbeHIKnv (ORCPT + 99 others); Thu, 9 Aug 2018 06:43:51 -0400 Received: from mail-eopbgr70104.outbound.protection.outlook.com ([40.107.7.104]:19265 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727371AbeHIKnv (ORCPT ); Thu, 9 Aug 2018 06:43:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7eysuHhm7NU/RDYqzaGe4KgJdI92HzEPh0GSlMFlIHg=; b=evKlTM8xZ+XUvJIto8ORG7A+IFGKBKzRA9Iwvk8efN9/JXOKEXB8bAyUlrm6wAg73qjeRI30XRw4ds9c4BhD8O337m+CRHeHPnATEhDI9iE4RMjH3dL+MxLK/7a88KQ+JQvmYCuvC/jjhjRh1pRWAVSOXCVWBgnOR5We1BcZrAI= Received: from linux-e4ne.site (79.164.103.161) by DB7PR08MB3115.eurprd08.prod.outlook.com (2603:10a6:5:1d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.18; Thu, 9 Aug 2018 08:20:00 +0000 Subject: Re: [PATCH 0/2] fs/lock: show locks info owned by dead/invisible processes To: Murphy Zhou References: <20180608142712.32460-1-khorenko@virtuozzo.com> Cc: Kirill Gorkunov , Andrey Vagin , Benjamin Coddington , Jeff Layton , "J. Bruce Fields" , Alexander Viro , Vasily Averin , Linux-Fsdevel , linux-kernel@vger.kernel.org From: Konstantin Khorenko Message-ID: <0f167223-fd55-7629-2eb0-48ec937668d3@virtuozzo.com> Date: Thu, 9 Aug 2018 11:20:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [79.164.103.161] X-ClientProxiedBy: VI1PR0202CA0003.eurprd02.prod.outlook.com (2603:10a6:803:14::16) To DB7PR08MB3115.eurprd08.prod.outlook.com (2603:10a6:5:1d::33) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 757fc614-3904-4ae0-4af8-08d5fdd0e76a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DB7PR08MB3115; X-Microsoft-Exchange-Diagnostics: 1;DB7PR08MB3115;3:NCyOz6NBjmk9CblfVXFodCJ5qIbtLejdI/VLMheNhJpTOw7XqBDH2GHg2zxP4LIM808EBLYxG/NB0gS8PrLMiy14c0PUjJCPTOGiVupf1P3uuZHxLnTLkGieU3JWo00cusTsBMBDykRm714XLCNt+txbeMDzHIFw0vnqfRU/ySxRZ5O5NbSDEyUjj8ujZZjBB3umC4RoXmpF2/s5LOMYTO7e9dGMTdHov7KQfspKcR1vCH8U7hXI5j0fn4OjhD6c;25:Cr1OaFhJuyGycHIJ+llV1O5OsBRBgzKJsd7QGe8skj90c4AIYNC/0l0RhE2F5Ctp4V9G8uci5GkfBKAWpfWiOHVsDEy6c35IoaXyWojx6Lt1CgN0r9i4T6dxYe0DmVdQjKpV7stecgo4sxZ7o35QtAlIetk9tOmimp04dxWK9DXglPzjjUK6KRNGlCbsInJw8La6dg4sJAJp4DWN35xZ0iZ0rBRJef6kJwCzN71RTdxgME7djn4l2V6rvTMd05Jiv6lSOL023bRPJyJUIGFcHw7hmnEX19wZBvPDgTHLP4N4mOoKy58QmmBiTUr/lsMjI8oFHtltcWWzQhox1cAZyA==;31:gDkFaD/5C4vGOOt0VXqGJU7nI92JGFhkMsljbVDu5kBiFHu5DJZzVPxOVwZEyqRwuZsITBruhd7PACmXD8nC7l+AuRNcwvZGxZ5fE8+hMn5jrCca0ynaYOC6+88sJV496JXL5FK1Nke4XxxaGwQdgL1WNlvXPt7/3rzdDrTlwGQ9c9RNZMtkNm0Sciz43xyzyb5tESwc4iCuGYry8NNPm94AWfPf3vZ9SJ+mGSGwVsE= X-MS-TrafficTypeDiagnostic: DB7PR08MB3115: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=khorenko@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1;DB7PR08MB3115;20:Db5bpEeoVOBXvqHzSr8OzInoUYJEm1UKNiJAjsc8Tw9KQLNBaeckKqYqsuEci6bG0TMp94vOJ+nO+p3xsKkmc6SrGH/gtr9ZEethztZtUpG4RynQioSFgUh86Mn3PDdi24nBShRc6uc6JcrClPTbQzgKMcO8Oun5XGlXQtTtcjB+z5FMM0cXPwv9BYAY5a+2z210bpFr6hnJYGRnzRwk1pYzSL4trco6XjPP607DXScT5AI7JOnNBBhDC4no1N+k3xun+qcqRJWw6DqNEn+n0SoIXfYStemb61avJUxgcUEJ9F3HhVM9Fzm5NWkB0ywBP38bodEzPzIt2VFCaRCo0mQgEZC8sT1KJaBNLSWzi5yLZ7YiDnit8mlz54lMnIG2pZLBfIeKmV00OnMlhRn2prLloNFXJc7eD4l0UTPrCl3wXJrfcGIFt+JkfUEd0LcM1aXBAlxodId4M3pKIUD5qeK5PRiZ+RSdwXzkTIlmpuQ2UhcWXgQMmbnPQVDnAJ7f;4:lv2ljdS7eiyps7elv1Gi5VwPbtUu1NKDUuTPler6Ku5hFJnekiTvP38i9UTh0PTW+dTVusTI0UAkkvfO03IvPpJF5AKSkGOuZ2z958CpK612FvZsEPZaGFj6tHQLZbZwtSWWnMbpr4a776yHF9cDomi5HUcthw5RODQpmY0cukYgTOfN80HEY12Tj7CQJaa4CCy1QylQnErsm5BrrhUb/Lo9dKhx+i2jK0jD+H7wHjW2Tp+JoJTS0BjdSwqhpeIfMSLFh2s2VdmLADXFMacdVQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:DB7PR08MB3115;BCL:0;PCL:0;RULEID:;SRVR:DB7PR08MB3115; X-Forefront-PRVS: 0759F7A50A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(346002)(366004)(376002)(136003)(39840400004)(396003)(199004)(189003)(36756003)(6486002)(23676004)(58126008)(69596002)(54906003)(6512007)(65956001)(316002)(47776003)(25786009)(6246003)(52146003)(64126003)(39060400002)(81166006)(67846002)(65806001)(66066001)(5660300001)(50466002)(4326008)(81156014)(2906002)(14444005)(229853002)(2486003)(305945005)(76176011)(52116002)(7736002)(65826007)(8676002)(31686004)(8936002)(186003)(16526019)(26005)(31696002)(478600001)(106356001)(105586002)(68736007)(446003)(97736004)(11346002)(2616005)(956004)(86362001)(486006)(6116002)(476003)(3846002)(53546011)(386003)(6506007)(6916009)(53936002)(21086003)(230700001);DIR:OUT;SFP:1102;SCL:1;SRVR:DB7PR08MB3115;H:linux-e4ne.site;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjdQUjA4TUIzMTE1OzIzOnU1STd3VDM1QVJvVnBDOHpsQitQbTlWamF4?= =?utf-8?B?ZnlsVHRlUWNaWDlGSDdKOHh1Q0dvVUZ6Vm1MN1h2ZnlpTCtvR2x3WjVJOHpE?= =?utf-8?B?RWFWQzVrY0doVElmeFdIWVM5ZW9VN014Z2RGa3BNZFkxVHlVSFdGMHU2QzFU?= =?utf-8?B?ZWhmQTNKQ3E3eUQ4N3BUblVmckZpWWthNDBpUGE3VEFKQ1AwTDRDNmxTcys0?= =?utf-8?B?WFB1Mm1yb1dQbk02d2t6THNSMExxZXhCT25MaTBEQkZ1YklNRVRLbVE4NGtC?= =?utf-8?B?WkZYQUxaN1FvR0FSSkRWejJ4WXk2NnRrRUVMSkRGMit2a3RsV29kKzMybHhI?= =?utf-8?B?UG01Wi95ZXVaSENiSFVDSHZsTGVyc011RWg1MVdCTHRMWURBcllhbTR3Snlv?= =?utf-8?B?VE8yVkx2OFVsVGlQaC9oYnI3UGZONlpkMWNUQmlPZVp0RCtDbUUzbWgvYXFF?= =?utf-8?B?eEZidlBSWkppdjZ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soft-Exchange-Diagnostics: 1;DB7PR08MB3115;20:618MNzYdKMSymQLk/0rDrYx0KSRdVdSVS+v3RDTNYWS+TlwVopTgRetljBPhyDi+KirsZq4mmwGUPKgRORK2L6/DmDlF2yUqBmHPGUBhhFkoi5v92ArpfdsvQ5SsBLcvf3cmNWrLTbLXzc0rFh/GMyz9pMKDx1PtKStohwNJA14= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2018 08:20:00.8914 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 757fc614-3904-4ae0-4af8-08d5fdd0e76a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3115 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/09/2018 10:16 AM, Murphy Zhou wrote: > Hi, > > Looks like this missed v4.18 ? Hi Murphy, yes, Jeff planned to push those patches into 4.19 and they are in "linux-next" now, but not in 4.18 "master" currently. On 06/14/2018 01:41 PM, Jeff Layton wrote: > These look fine to me. I'll plan to pick them up for v4.19 unless anyone > has objections. linux-next: 1cf8e5de4055 ("fs/lock: show locks taken by processes from another pidns") 826d7bc9f013 ("fs/lock: skip lock owner pid translation in case we are in init_pid_ns") -- Best regards, Konstantin Khorenko, Virtuozzo Linux Kernel Team > On Fri, Jun 8, 2018 at 10:27 PM, Konstantin Khorenko > wrote: >> The behavior has been changed after 9d5b86ac13c5 ("fs/locks: Remove fl_nspid >> and use fs-specific l_pid for remote locks") >> and now /proc/$PID/fdinfo/$FD does not show the info about the lock >> * if the flock owner process is dead and its pid has been already freed >> or >> * if the lock owner is not visible in current pidns. >> >> CRIU uses this interface to store locks info during dump and thus can break >> on v4.13 and newer. >> >> So let's show info about locks anyway in described cases (like it was before >> 9d5b86ac13c5), but show pid number saved in file_lock struct if we are in >> init_pid_ns (patch 1) or just zero otherwise (patch 2) like we do with SID. >> >> Reproducer: >> process A process A1 process A2 >> fork()---------> >> exit() open() >> flock() >> fork()---------> >> exit() sleep() >> >> Before the patch: >> ================ >> (root@vz7)/: cat /proc/${PID_A2}/fdinfo/3 >> pos: 4 >> flags: 02100002 >> mnt_id: 257 >> lock: (root@vz7)/: >> >> After the patch: >> =============== >> (root@vz7)/:cat /proc/${PID_A2}/fdinfo/3 >> pos: 4 >> flags: 02100002 >> mnt_id: 295 >> lock: 1: FLOCK ADVISORY WRITE ${PID_A1} b6:f8a61:529946 0 EOF >> >> =============== >> # cat flock1.c >> >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> >> int main(void) >> { >> int fd; >> int err; >> pid_t child_pid; >> >> child_pid = fork(); >> if (child_pid == -1) >> perror("fork failed"); >> if (child_pid) { >> exit(0); >> } >> >> fd = open("/tmp/a", O_CREAT | O_RDWR); >> if (fd == -1) >> perror("Failed to open the file"); >> >> err = flock(fd, LOCK_EX); >> if (err == -1) >> perror("flock failed"); >> >> child_pid = fork(); >> if (child_pid == -1) >> perror("fork failed"); >> if (child_pid) >> exit(0); >> >> sleep(10000); >> >> return 0; >> } >> >> Konstantin Khorenko (2): >> fs/lock: skip lock owner pid translation in case we are in init_pid_ns >> fs/lock: show locks taken by processes from another pidns >> >> fs/locks.c | 15 ++++++++++----- >> 1 file changed, 10 insertions(+), 5 deletions(-) >> >> -- >> 2.15.1 >> > . >