fs: devfs: implement d_revalidate hook
The files in devfs can change withouut the fs layer noticing, so we
have to revalidate dentries before using them.

A failure could be triggered with:

ls /dev/nand0.root.ubi; ubiattach /dev/nand0.root; ls /dev/nand0.root.ubi

The first 'ls' would create a dentry for nand0.root.ubi with no inode
associated since it does not yet exist. 'ubiattach' then creates that
file, but the second 'ls' does not show it since the dentry is not
revalidated and thus no inode is added to that dentry. This patch
fixes this and also the opposite case when a file is removed (for
example with ubidetach).

Reported-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 4e60154 commit b7705a105f62234465bfdd47769e1f9b9d632fd2
@Sascha Hauer Sascha Hauer authored on 17 Oct 2018
Showing 1 changed file
View
fs/devfs.c