From mboxrd@z Thu Jan 1 00:00:00 1970 From: J Freyensee Subject: Re: [PATCH v6 07/10] proc: flush task dcache entries from all procfs instances Date: Mon, 30 Dec 2019 14:03:29 -0800 Message-ID: <8d85ba43-0759-358e-137d-246107bac747@gmail.com> References: <20191225125151.1950142-1-gladkov.alexey@gmail.com> <20191225125151.1950142-8-gladkov.alexey@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20191225125151.1950142-8-gladkov.alexey@gmail.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Alexey Gladkov , LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module Cc: Akinobu Mita , Alexander Viro , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , "Eric W . Biederman" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Linus Torvalds , Oleg Nesterov , Solar Designer , Stephen Rothwell List-Id: linux-api@vger.kernel.org snip . . . > > +#ifdef CONFIG_PROC_FS > +static inline void pidns_proc_lock(struct pid_namespace *pid_ns) > +{ > + down_write(&pid_ns->rw_proc_mounts); > +} > + > +static inline void pidns_proc_unlock(struct pid_namespace *pid_ns) > +{ > + up_write(&pid_ns->rw_proc_mounts); > +} > + > +static inline void pidns_proc_lock_shared(struct pid_namespace *pid_ns) > +{ > + down_read(&pid_ns->rw_proc_mounts); > +} > + > +static inline void pidns_proc_unlock_shared(struct pid_namespace *pid_ns) > +{ > + up_read(&pid_ns->rw_proc_mounts); > +} > +#else /* !CONFIG_PROC_FS */ > + Apologies for my newbie question. I couldn't help but notice all these function calls are assuming that the parameter struct pid_namespace *pid_ns will never be NULL.  Is that a good assumption? I don't have the background in this code to answer on my own, but I thought I'd raise the question. Thanks, Jay