Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3251195ioa; Mon, 25 Apr 2022 22:56:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk+jDa4OJMZRHhRCM4fOIky/UafC5Orzg8lQ6rhKxYKZcbahGaCcffo5yWV8JiM9SkkSqy X-Received: by 2002:a17:906:66c8:b0:6e8:8b06:1b32 with SMTP id k8-20020a17090666c800b006e88b061b32mr19322654ejp.236.1650952603972; Mon, 25 Apr 2022 22:56:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650952603; cv=pass; d=google.com; s=arc-20160816; b=wFbFghckXuPhmmk9io8wffTZrilV+DpkldLvMvRdCf8OFSYXiZ4zE4WRIFL6VqixvN hnCS9eNZ1Nq55sE8hfXy0AwzUH695ACfDSi1cZX4/kHZmlBZWgpBes7xm3BUlXq8msAo KB7sKmfIHjhkpJ5vabx94qPWw50wlXC1UkadJGRuK5o3GpofZ6wPjXqtxg+DL1ZPKcgq 6KNUlT3G96LLY8aiUT3qNwqELta/7WXv67/y9LCX9KAQzvootsTZhWCSYmAY2hRdCln5 gtuuI5Fsos7ZmHpuzH1Z7yPr+bP3fAa20Bn7Dj5VWcWUQEkDp48Yc7WRShrIvsWD1vQa uqfw== 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:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=mdat8bV8W+a2nSatIkGCjtyRhbVHpD7hcfhb89nh+Xs=; b=ws+g+SpPcBFQqGgE33wVB+YcOF01+XgiJnBWeNgjxES40BYc5Zwr3Yj4SKXslau8ZQ ZsfD+QNc8UoOZgq8+kNL1Lj0TH1ETNdzj23/MwaHOV9wxxIYoha3jv/BU/P1mUw8KHmL ZKUOy3Og5QroOLOkNVtZ3VIF6YaCzkOUHHRjjaZ+zzaeyCnbZF0IeZpGLR1dyoaj4d7g msU6jx/Z6YIlZBREcphOUQQ7KyPi7zfh3ssyftMF6hmYwORixyYWdG+KV82zII6g6i8o w7xf8dUhSVF8RylKBhT3O5HBv1H35EgQgcw8Pn6OFJaMJzOURZw8aJGCVQbecHUelK8+ ZYYQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=i+iRWkpo; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vC+vo3LR; 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 ot13-20020a170906cccd00b006f38758b266si5641848ejb.160.2022.04.25.22.56.20; Mon, 25 Apr 2022 22:56:43 -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-2021-07-09 header.b=i+iRWkpo; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vC+vo3LR; 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 S237337AbiDZB6D (ORCPT + 99 others); Mon, 25 Apr 2022 21:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbiDZB6B (ORCPT ); Mon, 25 Apr 2022 21:58:01 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 004D8120D04 for ; Mon, 25 Apr 2022 18:54:55 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23Q0junV013187; Tue, 26 Apr 2022 01:54:49 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-2021-07-09; bh=mdat8bV8W+a2nSatIkGCjtyRhbVHpD7hcfhb89nh+Xs=; b=i+iRWkpoCs9NPINQ+nZaVVfWFRheCR9y0FsgKTydHivHBJdwJkPwGY722oisJ1xgMTVA JxEmStPXf8kCa0VEQ8oQDGc3DVjF9njyPW6XPP+Dy4X7+Do2K2VMmqbY4UwDxoEB+2T6 EvBHvnwvN7C9LMN/Zvm8r5uaxDX0aU3B1mYG1EinLQu5fkv59TqyDRmJ01WXBvyT4Oly cSvQWerVSaAFJLTGZXzY2pArubQp1LmtTKQ2OeJ18JSHFTzg7Ice7eWGt8XSVAd/phUk htfBkUbcfj2kqB9oi/r+sTfgAP1pcnf3BYAGzrntM7j2mEbOohwYLXco2opk2wg/XMWp XA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3fmb9amr8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Apr 2022 01:54:49 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 23Q1oTAP022367; Tue, 26 Apr 2022 01:54:47 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3fp5yj1r25-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Apr 2022 01:54:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m5q2qYGW3Q9bJxqvcbU2PAbndgsPl4IjDRcP8kxaww1v04B21m1mQQvTMFLeYuKqeTZX0KtjiqhV9yoL8n2uSTYK/586F/EMYC3Rz3dsomeNUpe8MaU+Ft3P+kVKBlIPZdpEfghhoUbzETERiB6d1y/WVZLstba4ur1Sjexpo0tRPHlYNkRIJGPvZ1rWu6CVjdBlB7UDcvSITr4yiGA9LhB0HnGz8VaZE2DtoFCuSYIRGYCA65JwuskeMXPkc8zU+KpRa2dguXrEWSQh4aDruF2jB64Jwy3QwvB9YTpYcefDA6hC9HEQs5kybmtn7S0g0RakjBMyHd768R5AaTFgoA== 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=mdat8bV8W+a2nSatIkGCjtyRhbVHpD7hcfhb89nh+Xs=; b=EogSP74QFKELue4p4LvkSxfSZTriOrGtOH5pYTYnYfJ3+Xk0eH0Eh5yefB6Sxfxtds5uVMWj65WSNyxNazWHPaxi58ZEE83BZU/Dk89F9Fif0DxaQjIzJP6b5j+ZXlGVVErB72i6/J9FQ9DkTW6dJK7O+Dz4CUYQvLr6/ZOY/iECTSIKSE1O4ac5M4ESlNAaEBfWcArFYauu8m4TkBz3dORArgcVeIGaqymEZYixiWesCD4FRESIVbZNPHtkp/k0qu8pXprIJpZQMwUK+P0pLcaV/OXSUSj6b+xxqi9kADjFZpxZObXeGNC/V8UuChQNfYqj/mseX3fe09ANI0KQ8w== 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=mdat8bV8W+a2nSatIkGCjtyRhbVHpD7hcfhb89nh+Xs=; b=vC+vo3LRCn8iQkdUEdigP4jHKOmljI6OG3okxmlfxIsVNdL+LxvLSvM5iL53P2QEjEokXw0aL93f57P/dntyu6hafmy71+IQy24pHxmPRgvvhnU8oUjsY7ltIY0lcHDQWZwd+8Cysgm+x28dWn2AQaepeMa5Ip4S4Efp11S0tcY= Received: from CO1PR10MB4468.namprd10.prod.outlook.com (2603:10b6:303:6c::24) by DM6PR10MB3642.namprd10.prod.outlook.com (2603:10b6:5:178::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.18; Tue, 26 Apr 2022 01:54:45 +0000 Received: from CO1PR10MB4468.namprd10.prod.outlook.com ([fe80::14ef:8202:73ba:29ec]) by CO1PR10MB4468.namprd10.prod.outlook.com ([fe80::14ef:8202:73ba:29ec%3]) with mapi id 15.20.5186.021; Tue, 26 Apr 2022 01:54:45 +0000 Message-ID: <4a778d83-df05-14e6-038a-9e0fb86f068e@oracle.com> Date: Tue, 26 Apr 2022 11:54:36 +1000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v8 02/10] kernfs: make ->attr.open RCU protected. Content-Language: en-US To: Tejun Heo Cc: viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, ebiederm@xmission.com, linux-kernel@vger.kernel.org References: <20220410023719.1752460-1-imran.f.khan@oracle.com> <20220410023719.1752460-3-imran.f.khan@oracle.com> From: Imran Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SY6PR01CA0092.ausprd01.prod.outlook.com (2603:10c6:10:111::7) To CO1PR10MB4468.namprd10.prod.outlook.com (2603:10b6:303:6c::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dcc16015-6f3c-41b2-5b06-08da2727bc91 X-MS-TrafficTypeDiagnostic: DM6PR10MB3642:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sxryrCHyNytiqt/6gpkm8HWyjrfscAKQmREZt5u2E3Tf++VOJOwFNppZ3j3YXS22WO21y2PRtRQBQ3U2QddDZb5FlLGAHE6f9W7uyPs2dmUyIX0SLTHmgvkWnabMJXlwnDugz5UKwl+gB0VUdxws9e5zHeo41L41NvzK7WkFXw49W5+HC9mV8RCC/zL6URXM/opEq2JrQ2NmXMpTA2P3EhTUaSeotZKYRC1TKGFTYYsrcfuGjRDik9YKLPrtCrd6LQUPNcmVepRe/KXznmkVz3p5+RLmvT4Uz8hyjBMVoALQ9ks5QWwDCl7Fk0TqvlQTp9+0jfOwZUtHA6w19aEDjMcSFKhrNwzaQb7oUkBkXKJMqQsg2Xx5WHN4isv1R7soaoF5d4aNfUQN6MR54DCrjUYYxpWFbDebtL54BAUfoT+h2478nDPtFq0ECM6Yo03ArCBicVRdVVGP84wIH/YwIfLgkVOvCg9Ug16opVjrCRx8pz36n5ZhAZB6eNeBWd6ealbTtv6B3+StTj2lFldAgiP6ZIwMwIIPzeX+fGKJkSBLgLpzjJy2rfwqeI/5+SXk2KxHpa1DbLka8TGelXoqkF1X9/Cl7HZ88FQvKSba7SE9AAG6PokVbxbfImh1XQdZhtzWyWHxmP1A+v6cWRKo4rfGCIY4nC3voR92ZVL3f8R8ibsxdvSZZlWmhyecSvE60pmkuqqM3NO6i47/jL0Ky6B+kVYfkVHZ1hwey5ZvgilmJ8cICrxwPLDIA2tGWfqtf3FqaDwa5NRqEhAvOE4CPr1aOx3DOYQVt8CXBi20cdU= 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:(13230001)(366004)(66556008)(31696002)(6512007)(8676002)(66946007)(66476007)(4326008)(2616005)(26005)(6916009)(6666004)(316002)(6486002)(86362001)(53546011)(508600001)(6506007)(186003)(83380400001)(38100700002)(2906002)(31686004)(8936002)(5660300002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?LzVKdFdITmovTEhib1NvQWJaN3ZaOW9WaDdKa0ZPRy9OTlhzNjYvMnpPTnY0?= =?utf-8?B?WFhYMkJsczBVUmZEZUZsU0tmdC9BVUYzc2NhUDBkK2tIV2dMZkdCeWtLR2ZK?= =?utf-8?B?K1MzY1JNaXQ4OE0zUTZyc0NoMkgxdEREbjdzL1dvU2tLekxpcU9sYTdJbk5G?= =?utf-8?B?Z1Ewa2QveTM3a3VTOEkvUGdYZzRLZ21sK3RDY2NRMVRYK0ZYMzJHWWtFZkhX?= =?utf-8?B?R2ZtWlN5QlNHa2dSeWEwcW16d0YvWTVNWE5JMWJKMUR0ODU1RjRXTmhhWjBZ?= =?utf-8?B?Wm9NTGNITGVqdn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S9ySTlaL2w5RGVTVVJh?= =?utf-8?B?bGJRYXJMMC85TWdZeEFrUk04dldrTms0OGZwMU9rcVEySjYvY2owWDZqZjFl?= =?utf-8?B?RHBodFE3Tzl0Uklhb1VLTUxvaDhHTGtiWFUzMitweHBqdlNEazZrdGIzR1lt?= =?utf-8?B?anJIYWpnb0JYQjJpeVRleER0Q2FPN01HampCUDI4YjZnVEw4bjdkNEYrdzhs?= =?utf-8?B?S1RpTjB1Z3NGSzk2MW9TbGt1ek1nMG5vcE00WGpZUDZDV0t4U2VZQkRXSXlj?= =?utf-8?Q?FE1ZG6G77INH3/QA=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcc16015-6f3c-41b2-5b06-08da2727bc91 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4468.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2022 01:54:45.0008 (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: JSLIzXkwkuAGSPK2XDppC8WqVac9ueGBH63EWkjAWLiht9YnBdDQF98SPJLiE/ROiu7FSfUgJ7+yPV9reROhtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB3642 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-04-25_08:2022-04-25,2022-04-25 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=648 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204260010 X-Proofpoint-ORIG-GUID: bST2MDyO8vYOsZdPJrw0aLBOyR39dTHi X-Proofpoint-GUID: bST2MDyO8vYOsZdPJrw0aLBOyR39dTHi X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 Tejun, On 23/4/22 2:19 am, Tejun Heo wrote: > On Sun, Apr 10, 2022 at 12:37:11PM +1000, Imran Khan wrote: >> static int kernfs_seq_show(struct seq_file *sf, void *v) >> { >> struct kernfs_open_file *of = sf->private; >> + struct kernfs_open_node *on = rcu_dereference_raw(of->kn->attr.open); > > I suppose raw deref is safe because @on can't go away while @of is alive, > right? Yes. If that's the case, please factor out of -> on dereferencing into a > helper and put a comment there explaining why the raw deref is safe. > Sure, will put dereferncing in a separate helper in next version. >> @@ -201,7 +203,8 @@ static ssize_t kernfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter) >> goto out_free; >> } >> >> - of->event = atomic_read(&of->kn->attr.open->event); >> + on = rcu_dereference_raw(of->kn->attr.open); > > cuz we don't wanna sprinkle raw derefs in multiple places without > explanation like this. > Agree. > ... >> /** >> @@ -566,24 +567,30 @@ static int kernfs_get_open_node(struct kernfs_node *kn, >> static void kernfs_put_open_node(struct kernfs_node *kn, >> struct kernfs_open_file *of) >> { >> - struct kernfs_open_node *on = kn->attr.open; >> - unsigned long flags; >> + struct kernfs_open_node *on; >> + >> + /* ->attr.open NULL means there are no more open files */ >> + if (rcu_dereference_raw(kn->attr.open) == NULL) >> + return; > > For pointer value check, what you want is rcu_access_pointer(). That said, > tho, why is this being called if no one is linked on it? Before removing the > refcnt, that'd be the same as trying to put a 0 ref. How does that happen? Yeah this check surely should not be needed. I will remove it in next version. > Also, can you please rename it to unlink or something of the sort? It's > confusing to call it put when there's no refcnt. > sure I will rename _put_ to _unlink_. >> >> mutex_lock(&kernfs_open_file_mutex); >> - spin_lock_irqsave(&kernfs_open_node_lock, flags); >> + >> + on = rcu_dereference_protected(kn->attr.open, >> + lockdep_is_held(&kernfs_open_file_mutex)); > > Again, a better way to do it would be defining a kn -> on accessor which > encodes the safe way to deref and use it. The deref rule is tied to the > deref itself not the callsite. > Okay I will factor this out in a separate helper. [...] >> static int kernfs_fop_open(struct inode *inode, struct file *file) >> @@ -765,12 +772,13 @@ void kernfs_drain_open_files(struct kernfs_node *kn) >> if (!(kn->flags & (KERNFS_HAS_MMAP | KERNFS_HAS_RELEASE))) >> return; >> >> - on = kn->attr.open; >> - if (!on) >> + if (rcu_dereference_raw(kn->attr.open) == NULL) >> return; > > rcu_access_pointer again and you gotta explain why the lockless check is > safe. > The lockless check is safe because no one will be adding to ->attr.open at this point of time. This allows early bail out if ->attr.open in already NULL. And if kernfs_put_open_node makes ->attr.open NULL, it does this under open_file_mutex so subsequent check under open_file_mutex will make sure to bail out if kernfs_put_open_node won the race. I will put an explanatory comment in the code, explaining the same. [...] >> @@ -912,14 +920,13 @@ void kernfs_notify(struct kernfs_node *kn) >> return; >> >> /* kick poll immediately */ >> - spin_lock_irqsave(&kernfs_open_node_lock, flags); >> - on = kn->attr.open; >> + rcu_read_lock(); >> + on = rcu_dereference(kn->attr.open); >> if (on) { >> atomic_inc(&on->event); >> wake_up_interruptible(&on->poll); >> } >> - spin_unlock_irqrestore(&kernfs_open_node_lock, flags); >> - >> + rcu_read_unlock(); > > An explanation of why this is safe in terms of event ordering would be great > here. > This is safe because here we don't need to refcnt ->on in this case. If writer (kernfs_put_open_node) has already made ->attr.open NULL we will bail out. If kernfs_notify got an old ->attr.open we can still safely process the event, even if kernfs_put_open_node updates ->attr.open to NULL in parallel. In both the cases the behaviour/order will be same as earlier code that used kernfs_open_node_lock. Please let me know if this answers your query or if something is still missing. Thanks -- Imran