mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
nfs: use file_dentry()
NFS may be used as lower layer of overlayfs and accessing f_path.dentry can
lead to a crash.
Fix by replacing direct access of file->f_path.dentry with the
file_dentry() accessor, which will always return a native object.
Fixes: 4bacc9c923
("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Tested-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: <stable@vger.kernel.org> # v4.2
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
d101a12595
commit
be62a1a8fd
3 changed files with 6 additions and 6 deletions
|
@ -940,7 +940,7 @@ int nfs_open(struct inode *inode, struct file *filp)
|
|||
{
|
||||
struct nfs_open_context *ctx;
|
||||
|
||||
ctx = alloc_nfs_open_context(filp->f_path.dentry, filp->f_mode);
|
||||
ctx = alloc_nfs_open_context(file_dentry(filp), filp->f_mode);
|
||||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
nfs_file_set_open_context(filp, ctx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue