From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABD2DC43387 for ; Mon, 14 Jan 2019 01:31:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75BD120656 for ; Mon, 14 Jan 2019 01:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbfANBbv (ORCPT ); Sun, 13 Jan 2019 20:31:51 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:17107 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726640AbfANBbu (ORCPT ); Sun, 13 Jan 2019 20:31:50 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 0EFC387F1B5628ED65C1; Mon, 14 Jan 2019 09:31:48 +0800 (CST) Received: from [10.177.19.236] (10.177.19.236) by smtp.huawei.com (10.3.19.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 14 Jan 2019 09:31:46 +0800 Subject: Re: [heads-up] buggered refcounting logics in cgroup1_mount() To: Tejun Heo , Al Viro References: <20190111072309.GT2217@ZenIV.linux.org.uk> <20190111205451.GX2509588@devbig004.ftw2.facebook.com> CC: Linus Torvalds , From: Zefan Li Message-ID: <5C3BE681.7050807@huawei.com> Date: Mon, 14 Jan 2019 09:31:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20190111205451.GX2509588@devbig004.ftw2.facebook.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.236] X-CFilter-Loop: Reflected Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 2019/1/12 4:54, Tejun Heo wrote: > Hello, Al. > > On Fri, Jan 11, 2019 at 07:23:09AM +0000, Al Viro wrote: >> AFAICS, a cleaner solution would be this: >> * to hell with kernfs_pin_sb(); just try to grab a reference to >> cgroup_root on reuse. >> * have cgroup_kill_sb() treat "it's already marked killed" as >> "just drop the reference, then". >> * after cgroup_do_mount() check if cgroup_root got marked killed and >> do deactivate_locked_super() in such case (with the same >> restart_syscall() failure exit). >> >> Objections? I would love to kill kernfs_pin_sb() as >> a followup (it's a fundamentally broken API), but that's not >> a stable fodder; some fix of refcounting bugs, OTOH, should be. > > cgroup1 hierarchies have really weird set of requirements and the > implementation has always been somewhat broken. I thought I fixed it > but obviously not. I have no objection whatsoever and would much > appreciate the work. > > Thanks a lot and happy new year! > +1. We've fixed bugs there quite a few times. Would be great to see it's fixed once and for all. Thnaks for the work!