Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2412446rdb; Thu, 21 Sep 2023 19:20:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/RdiUrnpLkNg/MC5friB6lqHqN4Jwz0R6PL3BT0QBroWpfdcM7zQHH8ybaj0VzOABowFL X-Received: by 2002:a05:6808:18a5:b0:3ad:f6ad:b9ba with SMTP id bi37-20020a05680818a500b003adf6adb9bamr7140145oib.13.1695349237353; Thu, 21 Sep 2023 19:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695349237; cv=none; d=google.com; s=arc-20160816; b=mnIWkXS2Vxa9czaF1htrw0U7R1An78gGYYyUeiCQdLa/MS67147HZC84QQyKTniWgM lVfHLZrXbkBvnLTe01HVUeUaaaWU56YqajITbo3QNJV0FJji+FQUrouEl7B5ZRhDK/Zx KwEBv36cywB+Jq7FT3kRZeyrZcfEPUevFVO34MMD2B4ojsJzQ6garvDw7UPNogYw0RW/ LCGvrhybAiCNmcyPXC8Kh3X5qqwLb/VbNsfWdGBBVgVlBhYMMK9VaouqI9+7UYj2ZHFL OxbLjBky9p1h1Ec/TCbss5Jei78rPGVizQdXbOM36/BoJlswlJqHQNDr4kKy4Mqs71JA Zwgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:to:subject:from :content-language:user-agent:mime-version:date:message-id; bh=lP5bzpT7KJ3Vh7xpEoaf4W3mWSlYEOpdZmGfHc1qpsc=; fh=BkiI6zXnGVbxPTYwVwYfmYTWBJM/RiYU3UT2kC4RI3w=; b=JLMxqAdfW7tB2QiG4UGy59xHsjhuESCB4FeHyP7e82sO+rS6rd/L/4jFPzE/cyN/aL eZbZGIcjHI3j2zCPOImbSslucXmNKZ6VKbvhZlPdYiFQjqsj70W9D3hIS9sOzxK4vv1x L1gifng6bfOt0bIiPBeUAPKYMbEbuj4kWy7DVbmBtyALZcVRiPIT3vc1yXWWTohjGWzv d8b9BCAox5cZ0ksOm9o1I7eShhVeFBSRQVBDwKVDYZGLye54JU3gKxNw+7kkYuIScK1E nbCyHiBs2CjjWdx490Vli3guuUSI6l3cTujFeiBcEdVcLYwG1BLvbwn1Am2tVxYfw2g4 vfjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id cf4-20020a056a02084400b00578ed63fda2si2781805pgb.156.2023.09.21.19.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 19:20:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id AC5E58112AA6; Thu, 21 Sep 2023 19:18:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbjIVCSi (ORCPT + 99 others); Thu, 21 Sep 2023 22:18:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbjIVCSg (ORCPT ); Thu, 21 Sep 2023 22:18:36 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E7F0CE; Thu, 21 Sep 2023 19:18:28 -0700 (PDT) Received: from kwepemi500024.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RsG7x3PY9zVl1r; Fri, 22 Sep 2023 10:15:25 +0800 (CST) Received: from [10.67.109.31] (10.67.109.31) by kwepemi500024.china.huawei.com (7.221.188.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 22 Sep 2023 10:18:25 +0800 Message-ID: <84e5fb5f-67c5-6d34-b93b-b307c6c9805c@huawei.com> Date: Fri, 22 Sep 2023 10:18:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Cai Xinchen Subject: [BUG?] fsconfig restart_syscall failed To: Tejun Heo , Zefan Li , Johannes Weiner , , Alexander Viro , Christian Brauner , , , Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.109.31] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500024.china.huawei.com (7.221.188.100) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 19:18:45 -0700 (PDT) Hello:   I am doing some test for kernel 6.4, util-linux version:2.39.1. Have you encountered similar problems? If there is a fix, please let me know. Thank you very much -------------------------------------------------- util-linux version 2.39.1 call mount use fsopen->fsconfig->fsmount->close instead of mount syscall. And use this shell test: #!/bin/bash mkdir -p /tmp/cgroup/cgrouptest while true do         mount -t cgroup -o none,name=foo cgroup /tmp/cgroup/cgrouptest         ret=$?         if [ $ret -ne 0 ];then                 echo "mount failed , $ret"         fi         umount /tmp/cgroup/cgrouptest         ret=$?         if [ $ret -ne 0 ];then                 echo "umount failed, $ret"         fi done And as a result, we mount cgroup immediately after umount, it will return failed. in fsconfig syscall, we find this stack: SYSCALL_DEFINE5(fsconfig, ...)         vfs_fsconfig_locked                 if (fc->phase != FS_CONTEXT_CREATE_PARAMS)                         return -EBUSY;                 vfs_get_tree                         fc->ops->get_tree // cgroup1_get_tree                                 if (!ret && !percpu_ref_tryget_live (&ctx->root->cgrp.self.refcnt))                                         ret = 1;                                 ...                                 if (unlikely(ret > 0)) {                                         msleep(10);                                         restart_syscall();                                 }                 ...                 fc->phase = FS_CONTEXT_FAILED; in mount syscall, no function will check fs->phase, and fc is recreate in monnt syscall. However, in fdconfig syscall, fc->phase is not initial as FS_CONTEXT_CREATE_PARAMS, restart_syscall will return -EBUSY. fc is created in fsopen syscall.