[RAMEN9610-9428] debugfs: call debugfs_real_fops() only after debugfs_file_get()
authorNicolai Stange <nicstange@gmail.com>
Mon, 30 Oct 2017 23:15:53 +0000 (00:15 +0100)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:09 +0000 (20:23 +0300)
commit2f4409eada221bee20d95714678998907b80245d
tree9cfb96b7a4b3bfbb0f02200399a7e37870a2fd22
parent8faafeab6e75b9dc0d958e944b93e60debdd5bb8
[RAMEN9610-9428] debugfs: call debugfs_real_fops() only after debugfs_file_get()

The current implementation of debugfs_real_fops() relies on a
debugfs_fsdata instance to be installed at ->d_fsdata.

With future patches introducing lazy allocation of these, this requirement
will be guaranteed to be fullfilled only inbetween a
debugfs_file_get()/debugfs_file_put() pair.

The full proxies' fops implemented by debugfs happen to be the only
offenders. Fix them up by moving their debugfs_real_fops() calls past those
to debugfs_file_get().

full_proxy_release() is special as it doesn't invoke debugfs_file_get() at
all. Leave it alone for now.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/debugfs/file.c