Re: WARNING: lock held when returning to user space in grab_super

From: Tejun Heo
Date: Wed Jan 02 2019 - 11:55:34 EST


On Thu, Jan 03, 2019 at 01:49:55AM +0900, Tetsuo Handa wrote:
> kernfs_node_dentry() calls lookup_one_len_unlocked() which involves
> memory allocation, and memory allocation fault injection made
> lookup_one_len_unlocked() fail, and thus kernfs_node_dentry() failed.
> What's strange?

So, kernfs_node_dentry() is called on the root kn, which should
trigger "if (!kn->parent) return dentry" in kernfs_node_dentry(), so
it shouldn't reach lookup_on_len_unlocked(). Oh I see. This is the
namespaced mount path, so kn can be non-root. Will fix it.

Thanks.

--
tejun