Return-Path: Received: from mail-ogi-t60-f220.ogicom.net ([213.108.60.220]:46356 "EHLO mail-ogi-t60-f220.ogicom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730AbeCFIFH (ORCPT ); Tue, 6 Mar 2018 03:05:07 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail43.ogicom.net (Postfix) with ESMTP id 6E7FB9C102F for ; Tue, 6 Mar 2018 08:58:28 +0100 (CET) Received: from mail43.ogicom.net ([213.108.60.206]) by localhost (mail43.ogicom.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Fi0NYCArpBkH for ; Tue, 6 Mar 2018 08:58:26 +0100 (CET) Received: from linux-m4k8.home (62-69-247-172.internetia.net.pl [62.69.247.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kb@sysmikro.com.pl) by mail43.ogicom.net (Postfix) with ESMTPSA id 599999C1025 for ; Tue, 6 Mar 2018 08:58:26 +0100 (CET) Message-ID: <1520323327.17111.23.camel@sysmikro.com.pl> Subject: advice on how to use path_get/put() From: Krzysztof =?UTF-8?Q?B=C5=82aszkowski?= To: Linux FS Devel Date: Tue, 06 Mar 2018 09:02:07 +0100 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, I look for advice regarding usage of these two function I mentioned. I'd like to be confident of that dentry - a member of structure path may be null for a while and mnt not.  Can it happen during rcu_walk ? I reckon that it doesn't happen when lookup falls into ref_walk and legitimize_path() evaluates the dentry pointer. Is it mandatory to call path_get/put under fs->lock ? Are there other precautions I should know about ? Thanks, -- Krzysztof Blaszkowski