Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp619060rwb; Thu, 27 Jul 2023 19:09:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlEoyInDRVNvas1SFUr6jF3i3QO+vodz3e4lxZzXEGUHQru4ztYToSUtOuE6tIRiQV0Rwzbn X-Received: by 2002:a5d:50cf:0:b0:317:3d78:c313 with SMTP id f15-20020a5d50cf000000b003173d78c313mr581833wrt.60.1690510192915; Thu, 27 Jul 2023 19:09:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690510192; cv=pass; d=google.com; s=arc-20160816; b=Iqvq4wA6wqlfodWycffc9My0nmhSLP4QXK0/52bEVc035zy+Xg3BN7hDAUKijyBFOA jMgFn8NLHeq0jmHsiK0J8XGa1qtr8tXf81W96pg45j+Q3kH4Lh2wH1K/3PizMTtN5ks/ Oh7T9FX4RvmSGXhoB74gp3a+wOdRiGWna9BHKMZhUvQ6LovKj+9c6Wx+Waa9DMMRwTSH pW5juEZdTNUFzaDG/BP8dMK94EdXEOb0uvkq7a1aIUNlFXN8nZwYAFqOr/PVLqmqQD93 p+Mbs38OPd+eSjaWkPYtWZzJd5F2dM2L//Sx3fz8xdkC9HluG1FMxsMGcX4nqJcsh/rE QTtw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=7bGFJajdP+3CLSDe71KBXqyaN6UuF1naT7Z0S8chF+4=; fh=DJpE0rrucHelU5El6drELH/NqsCqHzLY3Ny9H4/s4mU=; b=upzdTpBluektbAu60OfwQ//tsOtfr7dJ0p7q4e1i9gjfC6Z3GpjA96TtwDfByPpSrs uX82WKxaWD71Ub1VDbWgm6jwH2tidoLQtuDqVDC/Yr6Utd9AmgtrHa644NPUYWJBjP8k iUeAW3JhAWPKyM2ZcuuBm7sQw9cab/LCw9O2gFvA9LlPvECg3/uzUShLa/frS18tbAGt TzHh4OP3jjwfiKPCD98uq2eEAGm6I3ZfdHum3ImyEf5NSfBvzib7OLlqin3Qq9yRc7t/ WDejseLao5ZxEERgG8fTSNZ17QK9MPYX9r9NrEzlZ2dOjy7IWlXegPONjZnRyfRBKHjQ KAkw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=f0wG3dgo; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mZv2CjRq; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a05640208d100b005221dc07a73si1729342edz.122.2023.07.27.19.09.28; Thu, 27 Jul 2023 19:09:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=f0wG3dgo; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mZv2CjRq; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231504AbjG1BGl (ORCPT + 99 others); Thu, 27 Jul 2023 21:06:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231247AbjG1BGj (ORCPT ); Thu, 27 Jul 2023 21:06:39 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9D0930DE; Thu, 27 Jul 2023 18:06:37 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36RFO8m6028977; Fri, 28 Jul 2023 01:06:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=7bGFJajdP+3CLSDe71KBXqyaN6UuF1naT7Z0S8chF+4=; b=f0wG3dgoButCp6ApUimLunp96uVV84tnwRSbi12IDxbxzgTEjBp37Wf0TF7kxuESFjfj Jqmw/MJfKFVsao/qwQlJP9TllXIoOO4HvdfBNuBbFLtRRWWH5gWe2Q7mw1EEiZI8Zs/K 70ueamQwM6vR2RAfjNQuEaL5Ckc+jLVGv62194YEyNDT/TBRL31o30YFA9i6LLyqHO2H PuDIrWOc4IXfCwWhfMdCQ7Dh5qvFAOcZ2YAC2ySOhjp+ReDVVsdmN7HnX0PDuiBaPcEY EhpqjUAK+CCCOb+IMXxNimHcwhabZtQgXUF55gwMD+VAmDhS6bFZRYrqBkvHrUFxh2gO mA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s05he2w63-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jul 2023 01:06:23 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36RN850a011839; Fri, 28 Jul 2023 01:06:22 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3s05j8mara-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jul 2023 01:06:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oNlT+3rMLtWs65EiwFetBGA9lxdH5XaIaQK11sGSLAmlgXh1JMhbRJhwQXyV/nf47cxavMiuQcFcMou3HTWPkmGNXfJZ3Hrs27e7eGEm6dgZDVbJ+6QXoLJkE/eGfA4WOiQZFJHdqbCWD3hQheMuzObNY63O1hx1W/sD/MN44i3xp4+LGC126eQ2XKW2+gU4FPJH8Og5V49ld8efUrodiQz2Qs6wJ0G1A1Z8sg3yimDNSW+K2QpE3xXLQl2175YNGKFTgjNMh5hxecTl17P67oaBwFQH6ROQaQZhz0bcXBc/dV0XCZiQ1VwrBLkmVnAWAfoaIBzHxQ5T2y7/LmUTCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7bGFJajdP+3CLSDe71KBXqyaN6UuF1naT7Z0S8chF+4=; b=MWgSitwCJWqVUDvrAsKeKLvnO8olcQCZj8AGMUivJrILI8wPR74vlI842EKZygheAHZogGvNyyNUiIYeAgQigQFFLl/Ob+G5X2F0NOKwx1LLWMx5DfkuyLFzXIeNOqtjClScnlahGldGVYCEdvg1ubkCI1iRs69jLHJRfMGt9W4TrdJzCv+Hf3zpO0dB8KJMMdqKHx0wBi5RiS/eSVDSbzdsF36nQgdXg4Mq1HQgyyXAeuS7Ao58FXzHNHDiA/Ug3FJXA/y5ZBseswy7N7jsqyHjxH4AnnYW0GgsQyyq5QW3gg1ghFAJ8HLbppnio7b9OQ7iPEO/ZhPXqgYNZmHqdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7bGFJajdP+3CLSDe71KBXqyaN6UuF1naT7Z0S8chF+4=; b=mZv2CjRqhSNa5zZ8i33uHj+Na5W77SFm3PRXMn6gY2yI8RrGrAzv1npi7pJHXlLMEytk33EpJXvJGMDwv2vnJoZ6sRDDTqGYRjY7TcAGuxojQv0HkJy9kZJLeQpcppdC0/hmv1DgoIH/jEfz6uRElRYLfwUrEM23bt/8tISD3mc= Received: from CO1PR10MB4468.namprd10.prod.outlook.com (2603:10b6:303:6c::24) by IA1PR10MB7262.namprd10.prod.outlook.com (2603:10b6:208:3f8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Fri, 28 Jul 2023 01:06:20 +0000 Received: from CO1PR10MB4468.namprd10.prod.outlook.com ([fe80::2472:7089:2be3:802c]) by CO1PR10MB4468.namprd10.prod.outlook.com ([fe80::2472:7089:2be3:802c%3]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023 01:06:20 +0000 Message-ID: <120330e2-2b37-1d0c-de60-18ae66de573f@oracle.com> Date: Fri, 28 Jul 2023 11:06:12 +1000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 1/2] kernfs: dont take i_lock on inode attr read To: Ian Kent , Anders Roxell Cc: Arnd Bergmann , Tejun Heo , Greg Kroah-Hartman , Minchan Kim , Eric Sandeen , Alexander Viro , Rick Lindsley , David Howells , Miklos Szeredi , Carlos Maiolino , linux-fsdevel , Kernel Mailing List , elver@google.com References: <166606025456.13363.3829702374064563472.stgit@donald.themaw.net> <166606036215.13363.1288735296954908554.stgit@donald.themaw.net> <20221221133428.GE69385@mutt> <7815c8da-7d5f-c2c5-9dfd-7a77ac37c7f7@themaw.net> <9e35cf66-79ef-1f13-dc6b-b013c73a9fc6@themaw.net> <20230718190009.GC411@mutt> <76fcd1fe-b5f5-dd6b-c74d-30c2300f3963@themaw.net> <15eddad0-e73b-2686-b5ba-eaacc57b8947@themaw.net> <3505769d-9e7a-e76d-3aa7-286d689345b6@oracle.com> <996e11bf-5f22-3ab7-2951-92109649195d@themaw.net> <70d667af-661b-6f62-aa29-a3b8610feda6@themaw.net> Content-Language: en-US From: Imran Khan In-Reply-To: <70d667af-661b-6f62-aa29-a3b8610feda6@themaw.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BYAPR01CA0003.prod.exchangelabs.com (2603:10b6:a02:80::16) To CO1PR10MB4468.namprd10.prod.outlook.com (2603:10b6:303:6c::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR10MB4468:EE_|IA1PR10MB7262:EE_ X-MS-Office365-Filtering-Correlation-Id: 90314824-f7dd-4349-f9ed-08db8f06dabc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MSEXIJe73RSXcjo8y8IYJPlYSUbn352K3pv4xdDsi2uhn0F1hgn7DqjcWT/HEgoCJp2seMBFM2V65CJbBxZzhC+tI+5dksZaCexPGqViyRVK/+sQ+4bnJQ3fH+cwV6Kf8I6sMFb8+aV7CRKfVuJeCJknCB4w0vTFHellsj8zV5XupQ6BfpyaJiLD9uDUSAK70eSdRy1fvHkm02innW9GXr8hfZ/VeAJ7zOv6W+HWBSxZj2AMlTSmSSEx/Z1PRxbsfuwF4vukUH6ZAGxh+ExUo+ErWFGaUbtBH+5nt1RhXeXu1JiJIEUU3HQbRdOB88xhZJfZITzPKlneo+qi6XSEzuHCMOCUrVtrEjIBWhvQPsbW+UDVSAGt5AdCSmVpuqXUMiJHHQB3GDn4gG5b/K2ENOQlzsJryhsI0E4Ncx+ZhvoGOgvSpK07I4PdXCOBGhKJ6SQhFBt5h8FA/r7bV7ckAiGubmW6fp0u+Nf4zI/63PHRZF4RWBJ8+CPD5otNTw6KvBW/UK86jFI0AFYvx6UtLN65vws0ch+nKU5K4kXPCtBQaZA0Q9OOGLOj7I56sKhK8XG52+K5w9SMtVCVr4pmelAMHa9H4VYm/ttrdCQjfOfHLFchocHbJy6Hg212GRGw6pKaUHCzWV797qq0b63aC1urI92FdOqFhGawNTrEWpOwR/aqshB3NSVVXYE1DxMvMm4Da/9yOsFOXnOlopXodw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR10MB4468.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(376002)(136003)(366004)(346002)(396003)(451199021)(2906002)(31686004)(66899021)(7416002)(8936002)(66556008)(966005)(4326008)(41300700001)(316002)(2616005)(8676002)(66476007)(5660300002)(6512007)(54906003)(36756003)(186003)(66946007)(6506007)(53546011)(31696002)(6666004)(478600001)(110136005)(83380400001)(38100700002)(6486002)(26005)(86362001)(192303002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-Anti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VHVqekxxUHdPUjU5dko3eGpqb1ZhUWM2T2tBTTFXZnVtd2cv?= =?utf-8?B?YllReDE2S0pzcEh0dFVpaHJBU20vc09TVnFCUVZGLzh4NlJsMjNSQTIwKy85?= =?utf-8?B?SUE1Yll6VE5wTmhJRXlNc2p1bnRXcWIrY000MXB0cWhGbjlTY2hodGt5MlBk?= =?utf-8?B?WkFtRmFicExnWUdIOUJTN2QxdlB5VFZlcytrU25XQjBGYWVmNTRKQlhiRWhU?= =?utf-8?B?eUc4Zz09?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90314824-f7dd-4349-f9ed-08db8f06dabc X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4468.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 01:06:20.7877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /7Kd3ImsS702p9BP+7QwisDBmzX1mRziVUOjzTAbs6mwXQyZa+Fehf3+wFCWqVnZF0+oYAcdExIHoU8ep/v8+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7262 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-27_10,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307280008 X-Proofpoint-ORIG-GUID: aG_zHYRmZ4i9EKSB7PsMM1PwWzTXeYqD X-Proofpoint-GUID: aG_zHYRmZ4i9EKSB7PsMM1PwWzTXeYqD X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Ian, On 28/7/2023 10:16 am, Ian Kent wrote: > On 28/7/23 08:00, Ian Kent wrote: >> On 27/7/23 12:30, Imran Khan wrote: >>> Hello Ian, >>> Sorry for late reply. I was about to reply this week. >>> >>> On 27/7/2023 10:38 am, Ian Kent wrote: >>>> On 20/7/23 10:03, Ian Kent wrote: >>>>> On Wed, 2023-07-19 at 12:23 +0800, Ian Kent wrote: >>> [...] >>>>> I do see a problem with recent changes. >>>>> >>>>> I'll send this off to Greg after I've done some testing (primarily just >>>>> compile and function). >>>>> >>>>> Here's a patch which describes what I found. >>>>> >>>>> Comments are, of course, welcome, ;) >>>> Anders I was hoping you would check if/what lockdep trace >>>> >>>> you get with this patch. >>>> >>>> >>>> Imran, I was hoping you would comment on my change as it >>>> >>>> relates to the kernfs_iattr_rwsem changes. >>>> >>>> >>>> Ian >>>> >>>>> kernfs: fix missing kernfs_iattr_rwsem locking >>>>> >>>>> From: Ian Kent >>>>> >>>>> When the kernfs_iattr_rwsem was introduced a case was missed. >>>>> >>>>> The update of the kernfs directory node child count was also protected >>>>> by the kernfs_rwsem and needs to be included in the change so that the >>>>> child count (and so the inode n_link attribute) does not change while >>>>> holding the rwsem for read. >>>>> >>> kernfs direcytory node's child count changes in kernfs_(un)link_sibling and >>> these are getting invoked while adding (kernfs_add_one), >>> removing(__kernfs_remove) or moving (kernfs_rename_ns)a node. Each of these >>> operations proceed under kernfs_rwsem and I see each invocation of >>> kernfs_link/unlink_sibling during the above mentioned operations is happening >>> under kernfs_rwsem. >>> So the child count should still be protected by kernfs_rwsem and we should not >>> need to acquire kernfs_iattr_rwsem in kernfs_link/unlink_sibling. >> >> Yes, that's exactly what I intended (assuming you mean write lock in those cases) >> >> when I did it so now I wonder what I saw that lead to my patch, I'll need to look >> >> again ... > > Ahh, I see why I thought this ... > > It's the hunk: > > @@ -285,10 +285,10 @@ int kernfs_iop_permission(struct mnt_idmap *idmap, >         kn = inode->i_private; >         root = kernfs_root(kn); > > -       down_read(&root->kernfs_rwsem); > +       down_read(&root->kernfs_iattr_rwsem); >         kernfs_refresh_inode(kn, inode); >         ret = generic_permission(&nop_mnt_idmap, inode, mask); > -       up_read(&root->kernfs_rwsem); > +       up_read(&root->kernfs_iattr_rwsem); > >         return ret; >  } > > which takes away the kernfs_rwsem and introduces the possibility of > > the change. It may be more instructive to add back taking the read > > lock of kernfs_rwsem in .permission() than altering the sibling link > > and unlink functions, I mean I even caught myself on it. > Yes this was the block I referred to in my second comment [1]. However adding back read lock of kernfs_rwsem in .permission() will again introduce the bottleneck that I mentioned at [2]. So I think taking taking the locks in link/unlink is the better option. I understand having one lock to synchronize everything makes it easier debug/development wise but sometimes (such as the case mentioned in [2]), it is not optimum performance wise. Thoughts ? Thanks, Imran [1]: https://lore.kernel.org/all/8b0a1619-1e39-fc3a-1226-f3b167e64646@oracle.com/ [2]: https://lore.kernel.org/all/20230302043203.1695051-2-imran.f.khan@oracle.com/ > > Ian > >> >> >>> >>> Kindly let me know your thoughts. I would still like to see new lockdep traces >>> with this change. >> >> Indeed, I hope Anders can find time to get the trace. >> >> >> Ian >> >>> >>> Thanks, >>> Imran >>> >>>>> Fixes: 9caf696142 (kernfs: Introduce separate rwsem to protect inode >>>>> attributes) >>>>> >>>>> Signed-off-by: Ian Kent >>>>> Cc: Anders Roxell >>>>> Cc: Imran Khan >>>>> Cc: Arnd Bergmann >>>>> Cc: Minchan Kim >>>>> Cc: Eric Sandeen >>>>> --- >>>>>    fs/kernfs/dir.c |    4 ++++ >>>>>    1 file changed, 4 insertions(+) >>>>> >>>>> diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c >>>>> index 45b6919903e6..6e84bb69602e 100644 >>>>> --- a/fs/kernfs/dir.c >>>>> +++ b/fs/kernfs/dir.c >>>>> @@ -383,9 +383,11 @@ static int kernfs_link_sibling(struct kernfs_node >>>>> *kn) >>>>>        rb_insert_color(&kn->rb, &kn->parent->dir.children); >>>>>          /* successfully added, account subdir number */ >>>>> + down_write(&kernfs_root(kn)->kernfs_iattr_rwsem); >>>>>        if (kernfs_type(kn) == KERNFS_DIR) >>>>>            kn->parent->dir.subdirs++; >>>>>        kernfs_inc_rev(kn->parent); >>>>> +    up_write(&kernfs_root(kn)->kernfs_iattr_rwsem); >>>>>          return 0; >>>>>    } >>>>> @@ -408,9 +410,11 @@ static bool kernfs_unlink_sibling(struct >>>>> kernfs_node *kn) >>>>>        if (RB_EMPTY_NODE(&kn->rb)) >>>>>            return false; >>>>>    + down_write(&kernfs_root(kn)->kernfs_iattr_rwsem); >>>>>        if (kernfs_type(kn) == KERNFS_DIR) >>>>>            kn->parent->dir.subdirs--; >>>>>        kernfs_inc_rev(kn->parent); >>>>> +    up_write(&kernfs_root(kn)->kernfs_iattr_rwsem); >>>>>          rb_erase(&kn->rb, &kn->parent->dir.children); >>>>>        RB_CLEAR_NODE(&kn->rb); >>>>>