diff options
author | Miklos Szeredi <[email protected]> | 2016-03-26 16:14:37 -0400 |
---|---|---|
committer | Theodore Ts'o <[email protected]> | 2016-03-26 16:14:37 -0400 |
commit | d101a125954eae1d397adda94ca6319485a50493 (patch) | |
tree | 0f5853af51446f389c60f1a25f3875ef8a75ba41 /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | c9af28fdd44922a6c10c9f8315718408af98e315 (diff) |
fs: add file_dentry()
This series fixes bugs in nfs and ext4 due to 4bacc9c9234c ("overlayfs:
Make f_path always point to the overlay and f_inode to the underlay").
Regular files opened on overlayfs will result in the file being opened on
the underlying filesystem, while f_path points to the overlayfs
mount/dentry.
This confuses filesystems which get the dentry from struct file and assume
it's theirs.
Add a new helper, file_dentry() [*], to get the filesystem's own dentry
from the file. This checks file->f_path.dentry->d_flags against
DCACHE_OP_REAL, and returns file->f_path.dentry if DCACHE_OP_REAL is not
set (this is the common, non-overlayfs case).
In the uncommon case it will call into overlayfs's ->d_real() to get the
underlying dentry, matching file_inode(file).
The reason we need to check against the inode is that if the file is copied
up while being open, d_real() would return the upper dentry, while the open
file comes from the lower dentry.
[*] If possible, it's better simply to use file_inode() instead.
Signed-off-by: Miklos Szeredi <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Tested-by: Goldwyn Rodrigues <[email protected]>
Reviewed-by: Trond Myklebust <[email protected]>
Cc: <[email protected]> # v4.2
Cc: David Howells <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Daniel Axtens <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions